提交 1ccc7fbf 编写于 作者: P Pavel Hrdina

qemu_hotplug: fix checking graphics ports

We cannot change ports for running domain and we should error out if
autoport is enabled.
Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 9d88cbea
...@@ -2666,9 +2666,8 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, ...@@ -2666,9 +2666,8 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver,
switch (dev->type) { switch (dev->type) {
case VIR_DOMAIN_GRAPHICS_TYPE_VNC: case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
if ((olddev->data.vnc.autoport != dev->data.vnc.autoport) || if (olddev->data.vnc.autoport != dev->data.vnc.autoport ||
(!dev->data.vnc.autoport && olddev->data.vnc.port != dev->data.vnc.port) {
(olddev->data.vnc.port != dev->data.vnc.port))) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot change port settings on vnc graphics")); _("cannot change port settings on vnc graphics"));
goto cleanup; goto cleanup;
...@@ -2710,11 +2709,9 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, ...@@ -2710,11 +2709,9 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver,
break; break;
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
if ((olddev->data.spice.autoport != dev->data.spice.autoport) || if (olddev->data.spice.autoport != dev->data.spice.autoport ||
(!dev->data.spice.autoport && olddev->data.spice.port != dev->data.spice.port ||
(olddev->data.spice.port != dev->data.spice.port)) || olddev->data.spice.tlsPort != dev->data.spice.tlsPort) {
(!dev->data.spice.autoport &&
(olddev->data.spice.tlsPort != dev->data.spice.tlsPort))) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot change port settings on spice graphics")); _("cannot change port settings on spice graphics"));
goto cleanup; goto cleanup;
......
<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'/> <listen address='10.65.210.231' network='vdsm-rhevm' type='network'/>
<channel mode='secure' name='main'/> <channel mode='secure' name='main'/>
<channel mode='secure' name='display'/> <channel mode='secure' name='display'/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册