- pci-host: designware: Limit value range of iATU viewport register - hmat acpi: Fix out of bounds access due to missing use of indirection - migration: Skip only empty block devices - aspeed/hace: Initialize g_autofree pointer - hw/net/vmxnet3: Fix guest-triggerable assert() - qxl: don't assert() if device isn't yet initialized - Avoid unaligned fetch in ladr_match() - linux-user: Fix waitid return of siginfo_t and rusage - hw/net/lan9118: Replace magic '2048' value by MIL_TXFIFO_SIZE definition - stdvga: fix screen blanking - virtio-net: drop too short packets early - ebpf: replace deprecated bpf_program__set_socket_filter - vhsot-user: only read reply of SET_LOG_BASE from vq 0 - cpu: add Tengyun S5000C cpu support - hw/virtio: Fix obtain the buffer id from the last descriptor - hw/core: ensure kernel_end never gets used undefined Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com> (cherry picked from commit 1f9e476e96edb07e34e0133a312f478ddab4b6ff)
52 lines
1.8 KiB
Diff
52 lines
1.8 KiB
Diff
From 3fce4b6eed6f37140ff94ea119dd47caaf8eba10 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= <clg@redhat.com>
|
|
Date: Tue, 12 Mar 2024 13:04:31 +0100
|
|
Subject: [PATCH] migration: Skip only empty block devices
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
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>
|
|
(cherry picked from commit 2e128776dc56f502c2ee41750afe83938f389528)
|
|
Signed-off-by: zhujun2 <zhujun2_yewu@cmss.chinamobile.com>
|
|
---
|
|
migration/block.c | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/migration/block.c b/migration/block.c
|
|
index 391f8169fd..4055a6bb60 100644
|
|
--- a/migration/block.c
|
|
+++ b/migration/block.c
|
|
@@ -415,7 +415,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.41.0.windows.1
|
|
|