From 919d0b368e793d680549186a172ec763dba2df35 Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Mon, 16 May 2016 12:59:12 +0200 Subject: [PATCH] Revert "qemu_hotplug: fix checking graphics ports" 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 --- src/qemu/qemu_hotplug.c | 13 ++++++++----- .../qemuhotplug-graphics-spice-listen-network.xml | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 0dfaafcd3f..aa897d2333 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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; diff --git a/tests/qemuhotplugtestdata/qemuhotplug-graphics-spice-listen-network.xml b/tests/qemuhotplugtestdata/qemuhotplug-graphics-spice-listen-network.xml index f2a6aeb6e1..426a14db22 100644 --- a/tests/qemuhotplugtestdata/qemuhotplug-graphics-spice-listen-network.xml +++ b/tests/qemuhotplugtestdata/qemuhotplug-graphics-spice-listen-network.xml @@ -1,4 +1,4 @@ - +