projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c4c1e3
)
virtio-serial: Make sure virtqueue is ready before discarding data
author
Amit Shah
<amit.shah@redhat.com>
Fri, 4 Feb 2011 08:54:18 +0000
(14:24 +0530)
committer
Anthony Liguori
<aliguori@us.ibm.com>
Fri, 4 Feb 2011 12:33:26 +0000
(06:33 -0600)
This can happen if a port gets unplugged before guest has chance to
initialise vqs.
Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/virtio-serial-bus.c
patch
|
blob
|
history
diff --git
a/hw/virtio-serial-bus.c
b/hw/virtio-serial-bus.c
index 09e22aa44a2cdd031ce3e4b657453751cdc55fad..e05ab5e609691f0b04b55f061d16a5302455dfe3 100644
(file)
--- a/
hw/virtio-serial-bus.c
+++ b/
hw/virtio-serial-bus.c
@@
-117,6
+117,9
@@
static void discard_vq_data(VirtQueue *vq, VirtIODevice *vdev)
{
VirtQueueElement elem;
+ if (!virtio_queue_ready(vq)) {
+ return;
+ }
while (virtqueue_pop(vq, &elem)) {
virtqueue_push(vq, &elem, 0);
}