]> xenbits.xensource.com Git - libvirt.git/commitdiff
Revert "qemu_hotplug: fix checking graphics ports"
authorPavel Hrdina <phrdina@redhat.com>
Mon, 16 May 2016 10:59:12 +0000 (12:59 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 18 May 2016 15:16:56 +0000 (17:16 +0200)
This reverts commit 1ccc7fbff34ea44e5b0cf01a359d127a4c62a695.

We cannot check ports if autoport is set because we set ports to 0 while
parsing device XML.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1336134

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_hotplug.c
tests/qemuhotplugtestdata/qemuhotplug-graphics-spice-listen-network.xml

index 0dfaafcd3f036e8c8a7ae9c30cd257b0f461057e..aa897d2333bd0ec5056e8b740b6fd04d6bc4a047 100644 (file)
@@ -2671,8 +2671,9 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver,
 
     switch (dev->type) {
     case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
-        if (olddev->data.vnc.autoport != dev->data.vnc.autoport ||
-            olddev->data.vnc.port != dev->data.vnc.port) {
+        if ((olddev->data.vnc.autoport != dev->data.vnc.autoport) ||
+            (!dev->data.vnc.autoport &&
+             (olddev->data.vnc.port != dev->data.vnc.port))) {
             virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                            _("cannot change port settings on vnc graphics"));
             goto cleanup;
@@ -2714,9 +2715,11 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver,
         break;
 
     case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
-        if (olddev->data.spice.autoport != dev->data.spice.autoport ||
-            olddev->data.spice.port != dev->data.spice.port ||
-            olddev->data.spice.tlsPort != dev->data.spice.tlsPort) {
+        if ((olddev->data.spice.autoport != dev->data.spice.autoport) ||
+            (!dev->data.spice.autoport &&
+             (olddev->data.spice.port != dev->data.spice.port)) ||
+            (!dev->data.spice.autoport &&
+             (olddev->data.spice.tlsPort != dev->data.spice.tlsPort))) {
             virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                            _("cannot change port settings on spice graphics"));
             goto cleanup;
index f2a6aeb6e1336f4695638e7f91d411a5e588ec7c..426a14db227580b8e3abd13d9b77b6b272a0b45e 100644 (file)
@@ -1,4 +1,4 @@
-    <graphics autoport='yes' connected='disconnect' keymap='en-us' passwd='password2' passwdValidTo='2013-06-20T01:34:37' type='spice'>
+    <graphics autoport='yes' connected='disconnect' keymap='en-us' passwd='password2' passwdValidTo='2013-06-20T01:34:37' port='5900' tlsPort='5901' type='spice'>
       <listen address='10.65.210.231' network='vdsm-rhevm' type='network'/>
       <channel mode='secure' name='main'/>
       <channel mode='secure' name='display'/>