[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/10] migration: Skip only empty block devices
From: |
peterx |
Subject: |
[PULL 06/10] migration: Skip only empty block devices |
Date: |
Sun, 17 Mar 2024 16:57:59 -0400 |
From: Cédric Le Goater <clg@redhat.com>
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: 20240312120431.550054-1-clg@redhat.com">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 | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/migration/block.c b/migration/block.c
index 8c6ebafacc..2b9054889a 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -402,7 +402,10 @@ static int init_blk_migration(QEMUFile *f)
}
sectors = bdrv_nb_sectors(bs);
- if (sectors <= 0) {
+ if (sectors == 0) {
+ continue;
+ }
+ if (sectors < 0) {
ret = sectors;
bdrv_next_cleanup(&it);
goto out;
--
2.44.0
- [PULL 00/10] Migration 20240317 patches, peterx, 2024/03/17
- [PULL 01/10] io: Introduce qio_channel_file_new_dupfd, peterx, 2024/03/17
- [PULL 02/10] migration: Fix error handling after dup in file migration, peterx, 2024/03/17
- [PULL 03/10] physmem: Expose tlb_reset_dirty_range_all(), peterx, 2024/03/17
- [PULL 04/10] physmem: Factor cpu_physical_memory_dirty_bits_cleared() out, peterx, 2024/03/17
- [PULL 05/10] physmem: Fix migration dirty bitmap coherency with TCG memory access, peterx, 2024/03/17
- [PULL 06/10] migration: Skip only empty block devices,
peterx <=
- [PULL 07/10] migration: cpr-reboot documentation, peterx, 2024/03/17
- [PULL 09/10] migration/multifd: Ensure we're not given a socket for file migration, peterx, 2024/03/17
- [PULL 08/10] migration: Fix iocs leaks during file and fd migration, peterx, 2024/03/17
- [PULL 10/10] migration/multifd: Duplicate the fd for the outgoing_args, peterx, 2024/03/17
- Re: [PULL 00/10] Migration 20240317 patches, Peter Maydell, 2024/03/19