diff options
author | Amit Shah <amit.shah@redhat.com> | 2011-07-28 11:36:26 +0530 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-04 16:43:10 -0500 |
commit | ac720400e1730ff910d42442e4393044e7c132e0 (patch) | |
tree | 5553bd6ca7c63fb1686a3517044e7ba01341637a | |
parent | 855d7e259fe2a804f08698ca5c97d6b07fa79da1 (diff) |
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.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c index 0ce00495e2..072a88a382 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); } |