]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
libxl: only query VNC when enabled
authorJason Andryuk <jandryuk@gmail.com>
Thu, 1 Oct 2020 23:53:37 +0000 (19:53 -0400)
committerWei Liu <wl@xen.org>
Sun, 11 Oct 2020 20:59:16 +0000 (20:59 +0000)
QEMU without VNC support (configure --disable-vnc) will return an error
when VNC is queried over QMP since it does not recognize the QMP
command.  This will cause libxl to fail starting the domain even if VNC
is not enabled.  Therefore only query QEMU for VNC support when using
VNC, so a VNC-less QEMU will function in this configuration.

'goto out' jumps to the call to device_model_postconfig_done(), the
final callback after the chain of vnc queries.  This bypasses all the
QMP VNC queries.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Wei Liu <wl@xen.org>
tools/libs/light/libxl_dm.c

index a944181781bbe573d8756ff8083dd575d5072e95..d1ff35dda307d6c0c760afe39f82e5a58aee696f 100644 (file)
@@ -3140,6 +3140,7 @@ static void device_model_postconfig_chardev(libxl__egc *egc,
 {
     EGC_GC;
     libxl__dm_spawn_state *dmss = CONTAINER_OF(qmp, *dmss, qmp);
+    const libxl_vnc_info *vnc = libxl__dm_vnc(dmss->guest_config);
     const libxl__json_object *item = NULL;
     const libxl__json_object *o = NULL;
     int i = 0;
@@ -3197,6 +3198,9 @@ static void device_model_postconfig_chardev(libxl__egc *egc,
         if (rc) goto out;
     }
 
+    if (!vnc)
+        goto out;
+
     qmp->callback = device_model_postconfig_vnc;
     rc = libxl__ev_qmp_send(egc, qmp, "query-vnc", NULL);
     if (rc) goto out;