summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2011-07-28 11:36:26 +0530
committerAmit Shah <amit.shah@redhat.com>2011-07-28 15:10:39 +0530
commit868aa386b825e8058b8988ec7703908661af1e22 (patch)
tree73cd869d00ba561dc9dc4fe5984e12bd672b028c
parentvirtio-balloon: Add exit handler, fix memleaks (diff)
downloadqemu-kvm-868aa386b825e8058b8988ec7703908661af1e22.tar.gz
qemu-kvm-868aa386b825e8058b8988ec7703908661af1e22.tar.bz2
qemu-kvm-868aa386b825e8058b8988ec7703908661af1e22.zip
virtio-balloon: Unregister savevm section on device unplug
Migrating after unplugging a virtio-balloon device resulted in an error message on the destination: Unknown savevm section or instance '0000:00:04.0/virtio-balloon' 0 load of migration failed Fix this by unregistering the section on device unplug. Signed-off-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/virtio-balloon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c
index 0ce00495e..072a88a38 100644
--- a/hw/virtio-balloon.c
+++ b/hw/virtio-balloon.c
@@ -45,6 +45,7 @@ typedef struct VirtIOBalloon
size_t stats_vq_offset;
MonitorCompletion *stats_callback;
void *stats_opaque_callback_data;
+ DeviceState *qdev;
} VirtIOBalloon;
static VirtIOBalloon *to_virtio_balloon(VirtIODevice *vdev)
@@ -292,6 +293,7 @@ VirtIODevice *virtio_balloon_init(DeviceState *dev)
reset_stats(s);
+ s->qdev = dev;
register_savevm(dev, "virtio-balloon", -1, 1,
virtio_balloon_save, virtio_balloon_load, s);
@@ -300,5 +302,7 @@ VirtIODevice *virtio_balloon_init(DeviceState *dev)
void virtio_balloon_exit(VirtIODevice *vdev)
{
+ VirtIOBalloon *s = DO_UPCAST(VirtIOBalloon, vdev, vdev);
+ unregister_savevm(s->qdev, "virtio-balloon", s);
virtio_cleanup(vdev);
}