ioemu: limit xen-console buffering
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 1 Jul 2008 10:38:51 +0000 (11:38 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 1 Jul 2008 10:38:51 +0000 (11:38 +0100)
Set dom->buffer.max_capacity to xend configured limit.

Signed-off-by: Pat Campbell <plc@novell.com>
tools/ioemu/hw/xen_console.c

index fbd33f07fc9b751ac48282361b0f2b9f0e8a63ff..92c424740a167a978582f0b4f1a1d3dd659d5dc6 100644 (file)
@@ -160,16 +160,18 @@ int xs_gather(struct xs_handle *xs, const char *dir, ...)
 
 static int domain_create_ring(struct domain *dom)
 {
-       int err, remote_port, ring_ref, rc;
+       int err, remote_port, ring_ref, limit, rc;
 
        err = xs_gather(dom->xsh, dom->serialpath,
                        "ring-ref", "%u", &ring_ref,
                        "port", "%i", &remote_port,
+                       "limit", "%i", &limit,
                        NULL);
        if (err) {
                err = xs_gather(dom->xsh, dom->conspath,
                                "ring-ref", "%u", &ring_ref,
                                "port", "%i", &remote_port,
+                               "limit", "%i", &limit,
                                NULL);
                if (err) {
                        fprintf(stderr, "Console: failed to find ring-ref/port yet\n");
@@ -178,7 +180,9 @@ static int domain_create_ring(struct domain *dom)
                dom->use_consolepath = 1;
        } else
                dom->use_consolepath = 0;
-       fprintf(stderr, "Console: got ring-ref %d port %d\n", ring_ref, remote_port);
+       dom->buffer.max_capacity = limit;
+       fprintf(stderr, "Console: got ring-ref %d port %d limit %d\n", 
+               ring_ref, remote_port, limit);
 
        if ((ring_ref == dom->ring_ref) && (remote_port == dom->remote_port))
                goto out;