qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] virtio: correctly initialize vm_running


From: Jason Wang
Subject: [Qemu-devel] [PATCH] virtio: correctly initialize vm_running
Date: Wed, 18 May 2011 13:57:37 +0800
User-agent: StGit/0.15

Current vm_running was not explicitly initialized and its value was changed by
vm state notifier, this may confuse the virtio device being hotplugged such as
virtio-net with vhost backend as it may think the vm was not running. Solve this
by initialize this value explicitly in virtio_common_init().

Signed-off-by: Jason Wang <address@hidden>
---
 0 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/hw/virtio.c b/hw/virtio.c
index 6e8814c..27d7e50 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -789,6 +789,7 @@ 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);
+    vdev->vm_running = vm_running;
     for(i = 0; i < VIRTIO_PCI_QUEUE_MAX; i++) {
         vdev->vq[i].vector = VIRTIO_NO_VECTOR;
         vdev->vq[i].vdev = vdev;




reply via email to

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