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

Re: [Xen-devel] [PATCH v3] hvc_xen: implement multiconsole support

On Wed, 1 Feb 2012, Konrad Rzeszutek Wilk wrote:
> On Mon, Jan 30, 2012 at 04:02:31PM +0000, Stefano Stabellini wrote:
> > This patch implements support for multiple consoles:
> > consoles other than the first one are setup using the traditional xenbus
> > and grant-table based mechanism.
> > We use a list to keep track of the allocated consoles, we don't
> > expect too many of them anyway.
> >
> So looks good. applied to #testing. How do I test "multiple" consoles?

Interesting question :)

First of all testing a pv console alongside an emulated serial is easy:
by default xl creates a pv console for all hvm guests. So you just need
to start using it (something like console=ttyS0 console=hvc0 on a PV on
HVM guest).
You can connect to the pv console with the following command:

xl console -t pv <domain_name>

Then, in order to test multiple pv consoles, you need the toolstack to
create more than one for you (see appended patch that creates 2 pv
consoles for PV on HVM guests). If you create two pv consoles, you can
connect to the second one with the following command:

xl console -t pv -n 1 <domain_name>

BTW in the patch below I am seeting QEMU as console backend because it
is the only one that can handle multiple pv consoles.


diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index e1c615f..ec2c362 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -554,14 +554,21 @@ static int do_domain_create(libxl__gc *gc, 
libxl_domain_config *d_config,
     switch (d_config->c_info.type) {
-        libxl_device_console console;
+        libxl_device_console console, console2;
         libxl_device_vkb vkb;
         ret = init_console_info(&console, 0);
         if ( ret )
             goto error_out;
+        console.consback = LIBXL_CONSOLE_BACKEND_IOEMU;
         libxl__device_console_add(gc, domid, &console, &state);
+        ret = init_console_info(&console2, 1);
+        if ( ret )
+            goto error_out;
+        console2.consback = LIBXL_CONSOLE_BACKEND_IOEMU;
+        libxl__device_console_add(gc, domid, &console2, NULL);
+        libxl_device_console_dispose(&console2);
         ret = libxl_device_vkb_init(ctx, &vkb);
         if ( ret )

Xen-devel mailing list



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