ia64/xen-unstable

changeset 16237:a4df9c0c33fd

pv-qemu 10/10: Make xenconsoled ignore doms with qemu-dm

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.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
author Keir Fraser <keir@xensource.com>
date Thu Oct 25 14:45:47 2007 +0100 (2007-10-25)
parents e8905caa47b5
children b100412f621c
files tools/console/daemon/io.c tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/console/daemon/io.c	Thu Oct 25 14:45:07 2007 +0100
     1.2 +++ b/tools/console/daemon/io.c	Thu Oct 25 14:45:47 2007 +0100
     1.3 @@ -377,6 +377,7 @@ int xs_gather(struct xs_handle *xs, cons
     1.4  static int domain_create_ring(struct domain *dom)
     1.5  {
     1.6  	int err, remote_port, ring_ref, rc;
     1.7 +	char *type, path[PATH_MAX];
     1.8  
     1.9  	err = xs_gather(xs, dom->serialpath,
    1.10  			"ring-ref", "%u", &ring_ref,
    1.11 @@ -393,6 +394,14 @@ static int domain_create_ring(struct dom
    1.12  	} else
    1.13  		dom->use_consolepath = 0;
    1.14  
    1.15 +	sprintf(path, "%s/type", dom->use_consolepath ? dom->conspath: dom->serialpath);
    1.16 +	type = xs_read(xs, XBT_NULL, path, NULL);
    1.17 +	if (type && strcmp(type, "xenconsoled") != 0) {
    1.18 +		free(type);
    1.19 +		return 0;
    1.20 +	}
    1.21 +	free(type);
    1.22 +
    1.23  	if ((ring_ref == dom->ring_ref) && (remote_port == dom->remote_port))
    1.24  		goto out;
    1.25  
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Oct 25 14:45:07 2007 +0100
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Oct 25 14:45:47 2007 +0100
     2.3 @@ -916,8 +916,15 @@ class XendDomainInfo:
     2.4                  else:
     2.5                      to_store[n] = str(v)
     2.6  
     2.7 +        # Figure out if we need to tell xenconsoled to ignore this guest's
     2.8 +        # console - device model will handle console if it is running
     2.9 +        constype = "ioemu"
    2.10 +        if 'device_model' not in self.info['platform']:
    2.11 +            constype = "xenconsoled"
    2.12 +
    2.13          f('console/port',     self.console_port)
    2.14          f('console/ring-ref', self.console_mfn)
    2.15 +        f('console/type',     constype)
    2.16          f('store/port',       self.store_port)
    2.17          f('store/ring-ref',   self.store_mfn)
    2.18