ia64/xen-unstable

changeset 17934:73a4fbdfe0c4

ioemu: limit xen-console buffering
Set dom->buffer.max_capacity to xend configured limit.

Signed-off-by: Pat Campbell <plc@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jul 01 11:38:51 2008 +0100 (2008-07-01)
parents 763c32fdbd13
children 0c5183e764d8
files tools/ioemu/hw/xen_console.c
line diff
     1.1 --- a/tools/ioemu/hw/xen_console.c	Tue Jul 01 10:59:09 2008 +0100
     1.2 +++ b/tools/ioemu/hw/xen_console.c	Tue Jul 01 11:38:51 2008 +0100
     1.3 @@ -160,16 +160,18 @@ int xs_gather(struct xs_handle *xs, cons
     1.4  
     1.5  static int domain_create_ring(struct domain *dom)
     1.6  {
     1.7 -	int err, remote_port, ring_ref, rc;
     1.8 +	int err, remote_port, ring_ref, limit, rc;
     1.9  
    1.10  	err = xs_gather(dom->xsh, dom->serialpath,
    1.11  			"ring-ref", "%u", &ring_ref,
    1.12  			"port", "%i", &remote_port,
    1.13 +			"limit", "%i", &limit,
    1.14  			NULL);
    1.15  	if (err) {
    1.16  		err = xs_gather(dom->xsh, dom->conspath,
    1.17  				"ring-ref", "%u", &ring_ref,
    1.18  				"port", "%i", &remote_port,
    1.19 +				"limit", "%i", &limit,
    1.20  				NULL);
    1.21  		if (err) {
    1.22  			fprintf(stderr, "Console: failed to find ring-ref/port yet\n");
    1.23 @@ -178,7 +180,9 @@ static int domain_create_ring(struct dom
    1.24  		dom->use_consolepath = 1;
    1.25  	} else
    1.26  		dom->use_consolepath = 0;
    1.27 -	fprintf(stderr, "Console: got ring-ref %d port %d\n", ring_ref, remote_port);
    1.28 +	dom->buffer.max_capacity = limit;
    1.29 +	fprintf(stderr, "Console: got ring-ref %d port %d limit %d\n", 
    1.30 +		ring_ref, remote_port, limit);
    1.31  
    1.32  	if ((ring_ref == dom->ring_ref) && (remote_port == dom->remote_port))
    1.33  		goto out;