mirror of https://gitee.com/openkylin/qemu.git
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>
This commit is contained in:
parent
855d7e259f
commit
ac720400e1
|
@ -45,6 +45,7 @@ typedef struct VirtIOBalloon
|
||||||
size_t stats_vq_offset;
|
size_t stats_vq_offset;
|
||||||
MonitorCompletion *stats_callback;
|
MonitorCompletion *stats_callback;
|
||||||
void *stats_opaque_callback_data;
|
void *stats_opaque_callback_data;
|
||||||
|
DeviceState *qdev;
|
||||||
} VirtIOBalloon;
|
} VirtIOBalloon;
|
||||||
|
|
||||||
static VirtIOBalloon *to_virtio_balloon(VirtIODevice *vdev)
|
static VirtIOBalloon *to_virtio_balloon(VirtIODevice *vdev)
|
||||||
|
@ -292,6 +293,7 @@ VirtIODevice *virtio_balloon_init(DeviceState *dev)
|
||||||
|
|
||||||
reset_stats(s);
|
reset_stats(s);
|
||||||
|
|
||||||
|
s->qdev = dev;
|
||||||
register_savevm(dev, "virtio-balloon", -1, 1,
|
register_savevm(dev, "virtio-balloon", -1, 1,
|
||||||
virtio_balloon_save, virtio_balloon_load, s);
|
virtio_balloon_save, virtio_balloon_load, s);
|
||||||
|
|
||||||
|
@ -300,5 +302,7 @@ VirtIODevice *virtio_balloon_init(DeviceState *dev)
|
||||||
|
|
||||||
void virtio_balloon_exit(VirtIODevice *vdev)
|
void virtio_balloon_exit(VirtIODevice *vdev)
|
||||||
{
|
{
|
||||||
|
VirtIOBalloon *s = DO_UPCAST(VirtIOBalloon, vdev, vdev);
|
||||||
|
unregister_savevm(s->qdev, "virtio-balloon", s);
|
||||||
virtio_cleanup(vdev);
|
virtio_cleanup(vdev);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue