qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 16/18] test: vubr check vring enable state


From: marcandre . lureau
Subject: [Qemu-devel] [PATCH 16/18] test: vubr check vring enable state
Date: Fri, 1 Apr 2016 13:16:26 +0200

From: Marc-André Lureau <address@hidden>

The rings shouldn't be processed unless previously enabled.

Signed-off-by: Marc-André Lureau <address@hidden>
---
 tests/vhost-user-bridge.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c
index 0779ba2..42450a6 100644
--- a/tests/vhost-user-bridge.c
+++ b/tests/vhost-user-bridge.c
@@ -710,7 +710,8 @@ vubr_backend_recv_cb(int sock, void *ctx)
     int buflen = sizeof(buf);
     int len;
 
-    if (!dev->ready) {
+    if (!dev->ready || !rx_vq->enable) {
+        DPRINT("\n NOT READY: dev: %d, rx: %d\n", dev->ready, rx_vq->enable);
         return;
     }
 
@@ -747,8 +748,11 @@ vubr_kick_cb(int sock, void *ctx)
     if (rc == -1) {
         vubr_die("eventfd_read()");
     } else {
-        DPRINT("Got kick_data: %016"PRIx64"\n", kick_data);
-        vubr_process_avail(dev, &dev->vq[1]);
+        DPRINT("Got kick_data: %016"PRIx64", vq enabled: %d\n",
+               kick_data, dev->vq[1].enable);
+        if (dev->vq[1].enable) {
+            vubr_process_avail(dev, &dev->vq[1]);
+        }
     }
 }
 
-- 
2.5.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]