[PATCH v6 01/10] qemu_command: move websocket code into else part for address listen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is no need to check again for vnc socket.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index b5d84e6..8523992 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) {
-- 
2.8.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]