[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/3] vhost: Check+skip uninitialized VQs in vhost_ve
From: |
Nicholas A. Bellinger |
Subject: |
[Qemu-devel] [PATCH 3/3] vhost: Check+skip uninitialized VQs in vhost_verify_ring_mappings |
Date: |
Fri, 29 Mar 2013 04:33:12 +0000 |
From: Nicholas Bellinger <address@hidden>
With the virtio_queue_valid() checks in place to skip uninitialized VQs
within virtio-pci code, go ahead and skip the same uninitialized VQs
during vhost_verify_ring_mappings().
Note this patch does not prevent vhost_virtqueue_start() from executing
by checking virtio_queue_valid(), as other logic during seabios ->
virtio-scsi LLD guest hand-off appears to depend upon this execution.
Cc: Michael S. Tsirkin <address@hidden>
Cc: Asias He <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Signed-off-by: Nicholas Bellinger <address@hidden>
---
hw/vhost.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/hw/vhost.c b/hw/vhost.c
index 4d6aee3..3a71aee 100644
--- a/hw/vhost.c
+++ b/hw/vhost.c
@@ -314,6 +314,9 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev,
hwaddr l;
void *p;
+ if (!vq->ring_phys || !vq->ring_size) {
+ continue;
+ }
if (!ranges_overlap(start_addr, size, vq->ring_phys, vq->ring_size)) {
continue;
}
--
1.7.2.5