aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2009-09-07 21:20:15 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-11 10:19:46 -0500
commitb8193adbda922659ba290fd9fb6ee053ee191d70 (patch)
treea2713572832003a6345a02ec2216cbbf69b081dd /hw/virtio.c
parent711bf3d954371abffc07e397fc868a9c9e7e5585 (diff)
downloadqemu-b8193adbda922659ba290fd9fb6ee053ee191d70.zip
qemu-b8193adbda922659ba290fd9fb6ee053ee191d70.tar.gz
qemu-b8193adbda922659ba290fd9fb6ee053ee191d70.tar.bz2
qemu: init all queues to NO_VECTOR value
initialize vectors for all vqs to VIRTIO_NO_VECTOR rather than 0 which is a valid vector. This fixes migration which happened before driver was loaded. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reported-by: Amit Shah <amit.shah@redhat.com> Tested-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio.c')
-rw-r--r--hw/virtio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/virtio.c b/hw/virtio.c
index 41e7ca2..337ff27 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -694,6 +694,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id,
size_t config_size, size_t struct_size)
{
VirtIODevice *vdev;
+ int i;
vdev = qemu_mallocz(struct_size);
@@ -703,6 +704,8 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id,
vdev->queue_sel = 0;
vdev->config_vector = VIRTIO_NO_VECTOR;
vdev->vq = qemu_mallocz(sizeof(VirtQueue) * VIRTIO_PCI_QUEUE_MAX);
+ for(i = 0; i < VIRTIO_PCI_QUEUE_MAX; i++)
+ vdev->vq[i].vector = VIRTIO_NO_VECTOR;
vdev->name = name;
vdev->config_len = config_size;