aboutsummaryrefslogtreecommitdiff
path: root/hw
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
parent6b611d3ab820d6e3b30a23ebac69df04ab0105a0 (diff)
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')
-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 077c3183bc..8e611c03e0 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;