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

[Xen-devel] [PATCH] libxenlight: fix multiple console with stubdoms



Hi all,
libxenlight doesn't handle properly the multiple pv console case, needed
to support an emulated serial in hvm guests with stubdoms.
This patch fixes it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

---

diff -r 6f9ea06417df tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Mon Nov 30 10:29:45 2009 +0000
+++ b/tools/libxl/libxl.c       Mon Nov 30 14:20:26 2009 +0000
@@ -741,8 +741,8 @@
                                 libxl_device_vkb *vkb,
                                 libxl_device_model_starting **starting_r)
 {
-    int i;
-    libxl_device_console console;
+    int i, num_console = 1;
+    libxl_device_console *console;
     libxl_domain_create_info c_info;
     libxl_domain_build_info b_info;
     libxl_domain_build_state state;
@@ -807,11 +807,19 @@
     vkb_info_domid_fixup(vkb, domid);
     libxl_device_vkb_add(ctx, domid, vkb);
 
-    init_console_info(&console, 0, &state);
-    console_info_domid_fixup(&console, domid);
-    console.constype = CONSTYPE_IOEMU;
-    libxl_device_console_add(ctx, domid, &console);
-    libxl_create_xenpv_qemu(ctx, vfb, 1, &console, starting_r);
+    if (info->serial)
+        num_console++;
+    console = libxl_calloc(ctx, num_console, sizeof(libxl_device_console));
+    for (i = 0; i < num_console; i++) {
+        if (!i)
+            init_console_info(&console[i], i, &state);
+        else
+            init_console_info(&console[i], i, NULL);
+        console_info_domid_fixup(&console[i], domid);
+        console[i].constype = CONSTYPE_IOEMU;
+        libxl_device_console_add(ctx, domid, &console[i]);
+    }
+    libxl_create_xenpv_qemu(ctx, vfb, num_console, console, starting_r);
 
     libxl_domain_unpause(ctx, domid);
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.