From: mikeb Date: Fri, 29 Jul 2016 21:05:26 +0000 (+0000) Subject: Loop until we've read all available responses X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=55f4ff3de7886f674d9baf99ebdb78ee57c506be;p=openbsd Loop until we've read all available responses --- diff --git a/sys/dev/pv/xenstore.c b/sys/dev/pv/xenstore.c index c4647cfe3d2..b3c2ee9ac18 100644 --- a/sys/dev/pv/xenstore.c +++ b/sys/dev/pv/xenstore.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xenstore.c,v 1.28 2016/04/19 18:15:41 mikeb Exp $ */ +/* $OpenBSD: xenstore.c,v 1.29 2016/07/29 21:05:26 mikeb Exp $ */ /* * Copyright (c) 2015 Mike Belopuhov @@ -530,6 +530,7 @@ xs_intr(void *arg) /* Response processing */ + again: if (xs->xs_rmsg == NULL) { if (avail < sizeof(xmh)) { printf("%s: incomplete header: %d\n", @@ -597,6 +598,9 @@ xs_intr(void *arg) } } + if ((avail = xs_ring_avail(xsr, 0)) > 0) + goto again; + out: /* Wakeup sleeping writes (if any) */ wakeup(xs->xs_wchan);