]> git.proxmox.com Git - mirror_qemu.git/commit
migration: Skip only empty block devices
authorCédric Le Goater <clg@redhat.com>
Tue, 12 Mar 2024 12:04:31 +0000 (13:04 +0100)
committerPeter Xu <peterx@redhat.com>
Wed, 13 Mar 2024 11:33:41 +0000 (07:33 -0400)
commit2e128776dc56f502c2ee41750afe83938f389528
tree418f5ed2520d5f6f6f7316bb5201aa3c15502e38
parent03bfc2188f061aa8381403f9280555f4e22c35a2
migration: Skip only empty block devices

The block .save_setup() handler calls a helper routine
init_blk_migration() which builds a list of block devices to take into
account for migration. When one device is found to be empty (sectors
== 0), the loop exits and all the remaining devices are ignored. This
is a regression introduced when bdrv_iterate() was removed.

Change that by skipping only empty devices.

Cc: Markus Armbruster <armbru@redhat.com>
Cc: qemu-stable <qemu-stable@nongnu.org>
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Fixes: fea68bb6e9fa ("block: Eliminate bdrv_iterate(), use bdrv_next()")
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Link: https://lore.kernel.org/r/20240312120431.550054-1-clg@redhat.com
[peterx: fix "Suggested-by:"]
Signed-off-by: Peter Xu <peterx@redhat.com>
migration/block.c