[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT b8193ad] qemu: init all queues to NO_VECTOR value

From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT b8193ad] qemu: init all queues to NO_VECTOR value
Date: Fri, 11 Sep 2009 18:31:40 -0000

From: Michael S. Tsirkin <address@hidden>

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 <address@hidden>
Reported-by: Amit Shah <address@hidden>
Tested-by: Amit Shah <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

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 
                                  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 
     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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]