virtio-serial: Check if virtio queue is ready before consuming data
commit6b611d3ab820d6e3b30a23ebac69df04ab0105a0
authorAmit Shah <amit.shah@redhat.com>
Thu, 1 Jul 2010 09:28:16 +0000 (1 14:58 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 13 Jul 2010 14:06:58 +0000 (13 09:06 -0500)
treeb782027d4ee284f45ac8f400c61f247fe4faa7a3
parenta03c54f16eb35df6f8a08255cf44230a194c50bc
virtio-serial: Check if virtio queue is ready before consuming data

If a virtio-serial port is removed before the guest comes up and
initialises the virtqueues, qemu exits with the message

Guest moved used index from 0 to 61440

This happens because we try to clear any pending buffers from the
virtqueue.

Ensure the virtqueue is initialised before calling any virtqueue
operations.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/virtio-serial-bus.c