This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] Re: [PATCH v5] xen_console: support the new extended xenstor

On 30.06.2011, at 19:26, <stefano.stabellini@xxxxxxxxxxxxx> 
<stefano.stabellini@xxxxxxxxxxxxx> wrote:

> From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Since CS 21994 on xen-unstable.hg and CS
> 466608f3a32e1f9808acdf832a5843af37e5fcec on qemu-xen-unstable.git, few
> changes have been introduced to the PV console xenstore protocol, as
> described by the document docs/misc/console.txt under xen-unstable.hg.
> From the Qemu point of view, very few modifications are needed to
> correctly support the protocol: read from xenstore the "output" node
> that tell us what the output of the PV console is going to be.
> In case the output is a tty, write to xenstore the device name.

This one breaks my usual smoke test case of executing a Xen PV machine:

  $ ./x86_64-softmmu/qemu-system-x86_64 -xen-create -xen-domid 2 -M xenpv 
-kernel /boot/vmlinux-xen -initrd /boot/initrd-xen -append 'xencons=tty 
root=/dev/null' -nographic

How about this patch on top? That way you can still override Qemu's serial 
choice with xenstore, but keep the Qemu infrastructure in place for people who 
don't want to use it. This will be especially important when Xenner comes 
around, where a Xen PV VM feels the same as any other Qemu machine.

diff --git a/hw/xen_console.c b/hw/xen_console.c
index bdb8540..8ef104c 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -196,12 +196,15 @@ static int con_init(struct XenDevice *xendev)
     output = xenstore_read_str(con->console, "output");
-    /* output is a pty by default */
+    /* no Xen override, use qemu output device */
     if (output == NULL) {
-        output = "pty";
+        con->chr = serial_hds[con->xendev.dev];
+    } else {
+        snprintf(label, sizeof(label), "xencons%d", con->xendev.dev);
+        con->chr = qemu_chr_open(label, output, NULL);
-    snprintf(label, sizeof(label), "xencons%d", con->xendev.dev);
-    con->chr = qemu_chr_open(label, output, NULL);
     xenstore_store_pv_console_info(con->xendev.dev, con->chr);


Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>