From: Keir Fraser Date: Tue, 1 Jul 2008 10:38:51 +0000 (+0100) Subject: ioemu: limit xen-console buffering X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14192^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9c28c1b8b9f6cfaaa1eb998fe9a4cc28a9a42dcd;p=xen.git ioemu: limit xen-console buffering Set dom->buffer.max_capacity to xend configured limit. Signed-off-by: Pat Campbell --- diff --git a/tools/ioemu/hw/xen_console.c b/tools/ioemu/hw/xen_console.c index fbd33f07fc..92c424740a 100644 --- a/tools/ioemu/hw/xen_console.c +++ b/tools/ioemu/hw/xen_console.c @@ -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;