]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_hotplug: fix checking graphics ports
authorPavel Hrdina <phrdina@redhat.com>
Thu, 28 Apr 2016 15:55:11 +0000 (17:55 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 10 May 2016 08:44:46 +0000 (10:44 +0200)
We cannot change ports for running domain and we should error out if
autoport is enabled.

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

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