qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 12/18] virtio: Return -EINVAL if the vdev needs rese


From: Fam Zheng
Subject: [Qemu-devel] [PATCH 12/18] virtio: Return -EINVAL if the vdev needs reset in virtqueue_pop
Date: Fri, 17 Apr 2015 15:59:27 +0800

Signed-off-by: Fam Zheng <address@hidden>
---
 hw/virtio/virtio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 7ff0dc4..87f8c36 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -505,6 +505,9 @@ int virtqueue_pop(VirtQueue *vq, VirtQueueElement *elem, 
Error **errp)
     VirtIODevice *vdev = vq->vdev;
     Error *local_err = NULL;
 
+    if (virtio_device_needs_reset(vdev)) {
+        return -EINVAL;
+    }
     ret = virtqueue_num_heads(vq, vq->last_avail_idx, &local_err);
     if (ret <= 0) {
         goto err;
-- 
1.9.3




reply via email to

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