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

[Xen-changelog] [xen-unstable] libxenlight: fix multiple console with stubdoms



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259674450 0
# Node ID 1a6a109e48cef8920e2619ecef3c0d69b218d827
# Parent  bd52fff29e6e5d45331a7cef7927c628413e7def
libxenlight: fix multiple console with stubdoms

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>
---
 tools/libxl/libxl.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff -r bd52fff29e6e -r 1a6a109e48ce tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Mon Nov 30 11:48:36 2009 +0000
+++ b/tools/libxl/libxl.c       Tue Dec 01 13:34:10 2009 +0000
@@ -738,8 +738,8 @@ static int libxl_create_stubdom(struct l
                                 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;
@@ -804,11 +804,19 @@ retry_transaction:
     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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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