render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
9119d9
From 96f29c80cd0632d69296e8282f2ca7f4d83c0d22 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <96f29c80cd0632d69296e8282f2ca7f4d83c0d22@dist-git>
9119d9
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
9119d9
Date: Tue, 11 Nov 2014 14:57:27 +0100
9119d9
Subject: [PATCH] Fix virDomainChrEquals for spicevmc
9119d9
9119d9
virDomainChrSourceDefIsEqual should return 'true' for
9119d9
identical SPICEVMC chardevs, and those that have no source
9119d9
specification.
9119d9
9119d9
After this change, a failed hotplug no longer leaves a stale
9119d9
pointer in the domain definition.
9119d9
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=1162097
9119d9
(cherry picked from commit b987684ff63a20ab1301c48ca4842930be044f6d)
9119d9
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/conf/domain_conf.c | 7 ++++---
9119d9
 1 file changed, 4 insertions(+), 3 deletions(-)
9119d9
9119d9
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
9119d9
index 8f16d10..0e977fc 100644
9119d9
--- a/src/conf/domain_conf.c
9119d9
+++ b/src/conf/domain_conf.c
9119d9
@@ -1588,16 +1588,17 @@ virDomainChrSourceDefIsEqual(const virDomainChrSourceDef *src,
9119d9
                               tgt->data.spiceport.channel);
9119d9
         break;
9119d9
 
9119d9
+    case VIR_DOMAIN_CHR_TYPE_SPICEVMC:
9119d9
+        return src->data.spicevmc == tgt->data.spicevmc;
9119d9
+
9119d9
     case VIR_DOMAIN_CHR_TYPE_NULL:
9119d9
     case VIR_DOMAIN_CHR_TYPE_VC:
9119d9
     case VIR_DOMAIN_CHR_TYPE_STDIO:
9119d9
-    case VIR_DOMAIN_CHR_TYPE_SPICEVMC:
9119d9
     case VIR_DOMAIN_CHR_TYPE_LAST:
9119d9
-        /* nada */
9119d9
         break;
9119d9
     }
9119d9
 
9119d9
-    return false;
9119d9
+    return true;
9119d9
 }
9119d9
 
9119d9
 void virDomainChrDefFree(virDomainChrDefPtr def)
9119d9
-- 
9119d9
2.1.3
9119d9