From patchwork Tue Nov 20 14:26:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3/4] virtio-rng: disable timer on device removal Date: Tue, 20 Nov 2012 04:26:17 -0000 From: Amit Shah X-Patchwork-Id: 200347 Message-Id: <4174418d72ef8966c94434a814c2a67d5d33f646.1353421334.git.amit.shah@redhat.com> To: Anthony Liguori Cc: Amit Shah , Paolo Bonzini , qemu list Disable the rate-limit timer on device remove (e.g. hot-unplug). Signed-off-by: Amit Shah Reviewed-by: Anthony Liguori --- hw/virtio-rng.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c index cf5a8ff..c8a6da7 100644 --- a/hw/virtio-rng.c +++ b/hw/virtio-rng.c @@ -194,6 +194,8 @@ void virtio_rng_exit(VirtIODevice *vdev) { VirtIORNG *vrng = DO_UPCAST(VirtIORNG, vdev, vdev); + qemu_del_timer(vrng->rate_limit_timer); + qemu_free_timer(vrng->rate_limit_timer); unregister_savevm(vrng->qdev, "virtio-rng", vrng); virtio_cleanup(vdev); }