- migration: Skip only empty block devicesi - iotests: adapt to output change for recently introduced 'detached hea… - travis-ci: Rename SOFTMMU -> SYSTEM - block: disallow block jobs when there is a BDRV_O_INACTIVE flag - [backup] memory: bakcup hugepages: hugepages files maybe leftover - memory: [backup] Modify the VM's physical bits value set policy. - ui/clipboard: mark type as not available when there is no data (CVE-2023-6683) - virtio-net: correctly copy vnet header when flushing TX (CVE-2023-6693) Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
87 lines
3.0 KiB
Diff
87 lines
3.0 KiB
Diff
From 4506b31c0fff0b7a69ec4c7e264715ed70df75a8 Mon Sep 17 00:00:00 2001
|
|
From: gaojiazhen <gaojiazhen_yewu@cmss.chinamobile.com>
|
|
Date: Mon, 25 Mar 2024 22:13:43 +0800
|
|
Subject: [PATCH] migration: Skip only empty block devicesi
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
cheery-pick from 2e128776dc56f502c2ee41750afe83938f389528
|
|
|
|
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: fea68bb ("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>
|
|
Signed-off-by: Gao Jiazhen <gaojiazhen_yewu@cmss.chinamobile.com>
|
|
---
|
|
migration/block.c | 5 ++++-
|
|
tests/qemu-iotests/198.out | 2 --
|
|
tests/qemu-iotests/206.out | 1 -
|
|
3 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/migration/block.c b/migration/block.c
|
|
index a15f9bddcb..710ef6f490 100644
|
|
--- a/migration/block.c
|
|
+++ b/migration/block.c
|
|
@@ -409,7 +409,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;
|
|
diff --git a/tests/qemu-iotests/198.out b/tests/qemu-iotests/198.out
|
|
index 62fb73fa3e..805494916f 100644
|
|
--- a/tests/qemu-iotests/198.out
|
|
+++ b/tests/qemu-iotests/198.out
|
|
@@ -39,7 +39,6 @@ Format specific information:
|
|
compression type: COMPRESSION_TYPE
|
|
encrypt:
|
|
ivgen alg: plain64
|
|
- detached header: false
|
|
hash alg: sha256
|
|
cipher alg: aes-256
|
|
uuid: 00000000-0000-0000-0000-000000000000
|
|
@@ -85,7 +84,6 @@ Format specific information:
|
|
compression type: COMPRESSION_TYPE
|
|
encrypt:
|
|
ivgen alg: plain64
|
|
- detached header: false
|
|
hash alg: sha256
|
|
cipher alg: aes-256
|
|
uuid: 00000000-0000-0000-0000-000000000000
|
|
diff --git a/tests/qemu-iotests/206.out b/tests/qemu-iotests/206.out
|
|
index 979f00f9bf..7e95694777 100644
|
|
--- a/tests/qemu-iotests/206.out
|
|
+++ b/tests/qemu-iotests/206.out
|
|
@@ -114,7 +114,6 @@ Format specific information:
|
|
refcount bits: 16
|
|
encrypt:
|
|
ivgen alg: plain64
|
|
- detached header: false
|
|
hash alg: sha1
|
|
cipher alg: aes-128
|
|
uuid: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
--
|
|
2.27.0
|
|
|