From: Pavel Hrdina Date: Tue, 7 Jun 2016 22:14:24 +0000 (+0200) Subject: qemu_command: move websocket code into else part for address listen X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=fdff47c58733fe800b6d8e538afaac2754c1dd8e;p=libvirt.git qemu_command: move websocket code into else part for address listen There is no need to check again for vnc socket. Signed-off-by: Pavel Hrdina --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1eb34cf68f..9c88f58a7d 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7257,17 +7257,16 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg, } virBufferAsprintf(&opt, ":%d", graphics->data.vnc.port - 5900); - } - if (!graphics->data.vnc.socket && - graphics->data.vnc.websocket) { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VNC_WEBSOCKET)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("VNC WebSockets are not supported " - "with this QEMU binary")); - goto error; + if (graphics->data.vnc.websocket) { + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VNC_WEBSOCKET)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("VNC WebSockets are not supported " + "with this QEMU binary")); + goto error; + } + virBufferAsprintf(&opt, ",websocket=%d", graphics->data.vnc.websocket); } - virBufferAsprintf(&opt, ",websocket=%d", graphics->data.vnc.websocket); } if (graphics->data.vnc.sharePolicy) {