]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix virDomainChrEquals for spicevmc
authorJán Tomko <jtomko@redhat.com>
Mon, 10 Nov 2014 15:40:49 +0000 (16:40 +0100)
committerCole Robinson <crobinso@redhat.com>
Sat, 15 Nov 2014 21:02:09 +0000 (16:02 -0500)
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
(cherry picked from commit b987684ff63a20ab1301c48ca4842930be044f6d)

src/conf/domain_conf.c

index 6ea25df401ba334eb6cf55b613ac1711e196b8c8..c23a1f521919634dd210cc47fc526e019650ea32 100644 (file)
@@ -1590,16 +1590,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)