Loop until we've read all available responses
authormikeb <mikeb@openbsd.org>
Fri, 29 Jul 2016 21:05:26 +0000 (21:05 +0000)
committermikeb <mikeb@openbsd.org>
Fri, 29 Jul 2016 21:05:26 +0000 (21:05 +0000)
sys/dev/pv/xenstore.c

index c4647cf..b3c2ee9 100644 (file)
@@ -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);