tools/libxl: Support pv qemu without any vfbs
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 16 Aug 2010 12:33:54 +0000 (13:33 +0100)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 16 Aug 2010 12:33:54 +0000 (13:33 +0100)
Pv qemu provides backends for vfbs and consoles; even if no vfbs are
given can still be useful for the console backends.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c

index 98fdbe8a5671e2097c141e8a735b186b446c96bd..0d09adfd9e525d7f7ea24a91412bb307e8daeb68 100644 (file)
@@ -2592,17 +2592,20 @@ static int libxl_build_xenpv_qemu_args(libxl_gc *gc,
     libxl_ctx *ctx = libxl_gc_owner(gc);
     memset(info, 0x00, sizeof(libxl_device_model_info));
 
-    info->vnc = vfb->vnc;
-    if (vfb->vnclisten)
-        info->vnclisten = libxl_strdup(gc, vfb->vnclisten);
-    info->vncdisplay = vfb->vncdisplay;
-    info->vncunused = vfb->vncunused;
-    if (vfb->vncpasswd)
-        info->vncpasswd = vfb->vncpasswd;
-    if (vfb->keymap)
-        info->keymap = libxl_strdup(gc, vfb->keymap);
-    info->sdl = vfb->sdl;
-    info->opengl = vfb->opengl;
+    if (vfb != NULL) {
+        info->vnc = vfb->vnc;
+        if (vfb->vnclisten)
+            info->vnclisten = libxl_strdup(gc, vfb->vnclisten);
+        info->vncdisplay = vfb->vncdisplay;
+        info->vncunused = vfb->vncunused;
+        if (vfb->vncpasswd)
+            info->vncpasswd = vfb->vncpasswd;
+        if (vfb->keymap)
+            info->keymap = libxl_strdup(gc, vfb->keymap);
+        info->sdl = vfb->sdl;
+        info->opengl = vfb->opengl;
+    } else
+        info->nographic = 1;
     info->domid = domid;
     info->dom_name = libxl_domid_to_name(ctx, domid);
     info->device_model = libxl_abs_path(gc, "qemu-dm", libxl_libexec_path());