From: Ján Tomko Date: Mon, 10 Nov 2014 15:40:49 +0000 (+0100) Subject: Fix virDomainChrEquals for spicevmc X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b987684ff63a20ab1301c48ca4842930be044f6d;p=libvirt.git Fix virDomainChrEquals for spicevmc virDomainChrSourceDefIsEqual should return 'true' for identical SPICEVMC chardevs, and those that have no source specification. After this change, a failed hotplug no longer leaves a stale pointer in the domain definition. https://bugzilla.redhat.com/show_bug.cgi?id=1162097 --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 54b2bfe21b..2c65276b31 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1591,16 +1591,17 @@ virDomainChrSourceDefIsEqual(const virDomainChrSourceDef *src, tgt->data.spiceport.channel); break; + case VIR_DOMAIN_CHR_TYPE_SPICEVMC: + return src->data.spicevmc == tgt->data.spicevmc; + case VIR_DOMAIN_CHR_TYPE_NULL: case VIR_DOMAIN_CHR_TYPE_VC: case VIR_DOMAIN_CHR_TYPE_STDIO: - case VIR_DOMAIN_CHR_TYPE_SPICEVMC: case VIR_DOMAIN_CHR_TYPE_LAST: - /* nada */ break; } - return false; + return true; } void virDomainChrDefFree(virDomainChrDefPtr def)