summaryrefslogtreecommitdiff
path: root/hw/virtio.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-09-27 18:32:52 +0200
committerMichael S. Tsirkin <mst@redhat.com>2010-10-07 12:19:47 +0200
commit2a7873bd5c88dc28a46343606232c4776a20fc2b (patch)
tree70db30cf1ba848b3cabb593eaca866d6f8309203 /hw/virtio.c
parent71ba71d9feeda1d0543bc2d96bbe6ed1164e7995 (diff)
downloadqemu-2a7873bd5c88dc28a46343606232c4776a20fc2b.tar.gz
qemu-2a7873bd5c88dc28a46343606232c4776a20fc2b.tar.bz2
qemu-2a7873bd5c88dc28a46343606232c4776a20fc2b.zip
virtio: invoke set_status callback on reset
As status is set to 0 on reset, invoke the relevant callback. This makes for a cleaner code in devices as they don't need to duplicate the code in their reset routine, as well as excercises this path a little more. In particular this makes it possible to unify vhost-net handling code with the following patch. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio.c')
-rw-r--r--hw/virtio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/virtio.c b/hw/virtio.c
index fbef788854..c8a0fc6ff0 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -458,6 +458,8 @@ void virtio_reset(void *opaque)
VirtIODevice *vdev = opaque;
int i;
+ virtio_set_status(vdev, 0);
+
if (vdev->reset)
vdev->reset(vdev);