From: Michael S. Tsirkin Date: Mon, 27 Sep 2010 16:32:52 +0000 (+0200) Subject: virtio: invoke set_status callback on reset X-Git-Tag: v0.13.0~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8006040d47555cba456c9cc43374fba9e04e3bcc;p=thirdparty%2Fqemu.git 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 (cherry picked from commit e0c472d8c2795e523b0f9006dbe5bc22545c8300) --- diff --git a/hw/virtio.c b/hw/virtio.c index 85312b3ebed..f6ad42dcb91 100644 --- a/hw/virtio.c +++ b/hw/virtio.c @@ -453,6 +453,8 @@ void virtio_reset(void *opaque) VirtIODevice *vdev = opaque; int i; + virtio_set_status(vdev, 0); + if (vdev->reset) vdev->reset(vdev);