summaryrefslogtreecommitdiff
path: root/tools/virtio/ringtest/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/virtio/ringtest/main.c')
-rw-r--r--tools/virtio/ringtest/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/virtio/ringtest/main.c b/tools/virtio/ringtest/main.c
index b00ecd619969..f31353fac541 100644
--- a/tools/virtio/ringtest/main.c
+++ b/tools/virtio/ringtest/main.c
@@ -147,7 +147,7 @@ static void __attribute__((__flatten__)) run_guest(void)
assert(completed <= bufs);
assert(started <= bufs);
if (do_sleep) {
- if (enable_call())
+ if (used_empty() && enable_call())
wait_for_call();
} else {
poll_used();
@@ -172,7 +172,7 @@ static void __attribute__((__flatten__)) run_host(void)
for (;;) {
if (do_sleep) {
- if (enable_kick())
+ if (avail_empty() && enable_kick())
wait_for_kick();
} else {
poll_avail();