]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_command: move websocket code into else part for address listen
authorPavel Hrdina <phrdina@redhat.com>
Tue, 7 Jun 2016 22:14:24 +0000 (00:14 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 9 Jun 2016 12:22:27 +0000 (14:22 +0200)
There is no need to check again for vnc socket.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_command.c

index 1eb34cf68f383edd708ffc67a14a3c9f19310530..9c88f58a7d74c04756a4beddae5e7c6feaf4db4d 100644 (file)
@@ -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) {