WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] PATCH 10/10: Make xenconsoled ignore doms with qemu-dm

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] PATCH 10/10: Make xenconsoled ignore doms with qemu-dm
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Date: Wed, 24 Oct 2007 21:44:46 +0100
Delivery-date: Wed, 24 Oct 2007 13:46:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20071024203513.GD10807@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20071024203513.GD10807@xxxxxxxxxx>
Reply-to: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
This patch writes a field /local/vm/DOMID/console/type taking the
value 'ioemu' or 'xenconsoled'. If xenconsoled sees a type that is
not its own, then it skips handling of that guest. The qemu-dm
process doesn't need to read this field since it will only attach
to the console if given the -serial pty  arg which XenD already
ensures matches this xenstore field.

The overall behaviour is that if a paravirt guest has a qemu-dm
process running then that handles the console, otherwise the
xenconsoled handles it. The former is more functional, with the
exception of not currently supporting persistent logging to a
file at the same time as exposing a PTY.

 console/daemon/io.c               |    9 +++++++++
 python/xen/xend/XendDomainInfo.py |    7 +++++++
 2 files changed, 16 insertions(+)

 Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>


diff -r b090544a03f1 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Wed Oct 24 15:31:35 2007 -0400
+++ b/tools/console/daemon/io.c Wed Oct 24 15:37:24 2007 -0400
@@ -377,6 +377,7 @@ static int domain_create_ring(struct dom
 static int domain_create_ring(struct domain *dom)
 {
        int err, remote_port, ring_ref, rc;
+       char *type, path[PATH_MAX];
 
        err = xs_gather(xs, dom->serialpath,
                        "ring-ref", "%u", &ring_ref,
@@ -393,6 +394,14 @@ static int domain_create_ring(struct dom
        } else
                dom->use_consolepath = 0;
 
+       sprintf(path, "%s/type", dom->use_consolepath ? dom->conspath: 
dom->serialpath);
+       type = xs_read(xs, XBT_NULL, path, NULL);
+       if (type && strcmp(type, "xenconsoled") != 0) {
+               free(type);
+               return 0;
+       }
+       free(type);
+
        if ((ring_ref == dom->ring_ref) && (remote_port == dom->remote_port))
                goto out;
 
diff -r b090544a03f1 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Oct 24 15:31:35 2007 -0400
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Oct 24 15:37:24 2007 -0400
@@ -916,8 +916,15 @@ class XendDomainInfo:
                 else:
                     to_store[n] = str(v)
 
+        # Figure out if we need to tell xenconsoled to ignore this guest's
+        # console - device model will handle console if it is running
+        constype = "ioemu"
+        if 'device_model' not in self.info['platform']:
+            constype = "xenconsoled"
+
         f('console/port',     self.console_port)
         f('console/ring-ref', self.console_mfn)
+        f('console/type',     constype)
         f('store/port',       self.store_port)
         f('store/ring-ref',   self.store_mfn)
 

-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

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

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