aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-serial-bus.c
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2010-07-01 14:58:17 +0530
committerAnthony Liguori <aliguori@us.ibm.com>2010-07-13 09:06:58 -0500
commitfd11a78be8dfc992a5c642d8e2e1ebd80a761b86 (patch)
tree92ea3921151e8ee5d114cdc178dc901fc43563e5 /hw/virtio-serial-bus.c
parent6b611d3ab820d6e3b30a23ebac69df04ab0105a0 (diff)
downloadqemu-fd11a78be8dfc992a5c642d8e2e1ebd80a761b86.zip
qemu-fd11a78be8dfc992a5c642d8e2e1ebd80a761b86.tar.gz
qemu-fd11a78be8dfc992a5c642d8e2e1ebd80a761b86.tar.bz2
virtio-serial: Assert for virtio queue ready before virtqueue operations
In addition to the previous fix for calling do_flush_queued_data() only when the virtqueue is ready, ensure do_flush_queued_data() gets a vq that's suitably initialised. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-serial-bus.c')
-rw-r--r--hw/virtio-serial-bus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 077c318..8e611c0 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -117,6 +117,7 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq,
VirtQueueElement elem;
assert(port || discard);
+ assert(virtio_queue_ready(vq));
while ((discard || !port->throttled) && virtqueue_pop(vq, &elem)) {
uint8_t *buf;