From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu 1/9] add patch to allow mirror job to use non-root block node
Date: Fri, 24 Jul 2026 16:32:22 +0200 [thread overview]
Message-ID: <20260724143240.211130-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20260724143240.211130-1-f.ebner@proxmox.com>
This is in preparation to fix the regression from bug #7299 and have
guest throttle limits not apply to mirror operations too.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
...d-support-for-sync-bitmap-mode-never.patch | 8 +--
...check-for-bitmap-mode-without-bitmap.patch | 2 +-
.../0006-mirror-move-some-checks-to-qmp.patch | 2 +-
...ror-do-not-require-a-root-block-node.patch | 68 +++++++++++++++++++
...ckup-Proxmox-backup-patches-for-QEMU.patch | 2 +-
debian/patches/series | 1 +
6 files changed, 76 insertions(+), 7 deletions(-)
create mode 100644 debian/patches/extra/0053-blockdev-mirror-do-not-require-a-root-block-node.patch
diff --git a/debian/patches/bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch b/debian/patches/bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch
index 0fb45d16e0..b32e871d96 100644
--- a/debian/patches/bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch
+++ b/debian/patches/bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch
@@ -229,7 +229,7 @@ index 089856f4a8..e6f645e0f2 100644
base_read_only, errp);
if (!job) {
diff --git a/blockdev.c b/blockdev.c
-index 6e86c6262f..b68dfef260 100644
+index 0f70973326..aa39048dd5 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2859,6 +2859,9 @@ static void blockdev_mirror_common(const char *job_id, BlockDriverState *bs,
@@ -289,7 +289,7 @@ index 6e86c6262f..b68dfef260 100644
target_is_zero, on_source_error, on_target_error, unmap,
filter_node_name, copy_mode, errp);
}
-@@ -3111,6 +3138,8 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
+@@ -3117,6 +3144,8 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
blockdev_mirror_common(arg->job_id, bs, target_bs,
arg->replaces, arg->sync,
@@ -298,7 +298,7 @@ index 6e86c6262f..b68dfef260 100644
backing_mode, target_is_zero,
arg->has_speed, arg->speed,
arg->has_granularity, arg->granularity,
-@@ -3130,6 +3159,8 @@ void qmp_blockdev_mirror(const char *job_id,
+@@ -3136,6 +3165,8 @@ void qmp_blockdev_mirror(const char *job_id,
const char *device, const char *target,
const char *replaces,
MirrorSyncMode sync,
@@ -307,7 +307,7 @@ index 6e86c6262f..b68dfef260 100644
bool has_speed, int64_t speed,
bool has_granularity, uint32_t granularity,
bool has_buf_size, int64_t buf_size,
-@@ -3168,7 +3199,8 @@ void qmp_blockdev_mirror(const char *job_id,
+@@ -3182,7 +3213,8 @@ void qmp_blockdev_mirror(const char *job_id,
}
blockdev_mirror_common(job_id, bs, target_bs,
diff --git a/debian/patches/bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch b/debian/patches/bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch
index dadb0e6f85..773139a4ab 100644
--- a/debian/patches/bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch
+++ b/debian/patches/bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch
@@ -16,7 +16,7 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
1 file changed, 3 insertions(+)
diff --git a/blockdev.c b/blockdev.c
-index b68dfef260..878e47a321 100644
+index aa39048dd5..1d0494a090 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2952,6 +2952,9 @@ static void blockdev_mirror_common(const char *job_id, BlockDriverState *bs,
diff --git a/debian/patches/bitmap-mirror/0006-mirror-move-some-checks-to-qmp.patch b/debian/patches/bitmap-mirror/0006-mirror-move-some-checks-to-qmp.patch
index 98c3f7b93d..abf1f03770 100644
--- a/debian/patches/bitmap-mirror/0006-mirror-move-some-checks-to-qmp.patch
+++ b/debian/patches/bitmap-mirror/0006-mirror-move-some-checks-to-qmp.patch
@@ -62,7 +62,7 @@ index 0f56ad1f54..75563e6e75 100644
if (bitmap_mode != BITMAP_SYNC_MODE_NEVER) {
diff --git a/blockdev.c b/blockdev.c
-index 878e47a321..d9575c8367 100644
+index 1d0494a090..9da3f5b8bb 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2931,7 +2931,36 @@ static void blockdev_mirror_common(const char *job_id, BlockDriverState *bs,
diff --git a/debian/patches/extra/0053-blockdev-mirror-do-not-require-a-root-block-node.patch b/debian/patches/extra/0053-blockdev-mirror-do-not-require-a-root-block-node.patch
new file mode 100644
index 0000000000..b8667d7bfa
--- /dev/null
+++ b/debian/patches/extra/0053-blockdev-mirror-do-not-require-a-root-block-node.patch
@@ -0,0 +1,68 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Fiona Ebner <f.ebner@proxmox.com>
+Date: Fri, 27 Feb 2026 10:39:13 +0100
+Subject: [PATCH] blockdev: mirror: do not require a root block node
+
+The mirror block job currently only operates on a root block node. It
+might be desired to use a throttle node as the root node for limiting
+the guest IO, without also limiting mirror operations.
+
+There is no obvious reason why mirror should only be able to operate
+on a root block node.
+
+When there is no explicit @replaces argument, implicit filters on top
+are skipped. Allowing mirror to operate on non-root nodes does not
+change that fact and keeps the behavior consistent with the
+documentation for @replaces.
+
+Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
+---
+ blockdev.c | 20 +++++++++++++++++---
+ 1 file changed, 17 insertions(+), 3 deletions(-)
+
+diff --git a/blockdev.c b/blockdev.c
+index 6e86c6262f..0f70973326 100644
+--- a/blockdev.c
++++ b/blockdev.c
+@@ -2987,13 +2987,19 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp)
+ bool target_is_zero;
+ int ret;
+
+- bs = qmp_get_root_bs(arg->device, errp);
++ bdrv_graph_rdlock_main_loop();
++ bs = bdrv_lookup_bs(arg->device, arg->device, errp);
+ if (!bs) {
++ bdrv_graph_rdunlock_main_loop();
++ return;
++ }
++ if (!bdrv_is_inserted(bs)) {
++ error_setg(errp, "Device has no medium");
++ bdrv_graph_rdunlock_main_loop();
+ return;
+ }
+
+ /* Early check to avoid creating target */
+- bdrv_graph_rdlock_main_loop();
+ if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_MIRROR_SOURCE, errp)) {
+ bdrv_graph_rdunlock_main_loop();
+ return;
+@@ -3150,10 +3156,18 @@ void qmp_blockdev_mirror(const char *job_id,
+ BlockMirrorBackingMode backing_mode = MIRROR_LEAVE_BACKING_CHAIN;
+ int ret;
+
+- bs = qmp_get_root_bs(device, errp);
++ bdrv_graph_rdlock_main_loop();
++ bs = bdrv_lookup_bs(device, device, errp);
+ if (!bs) {
++ bdrv_graph_rdunlock_main_loop();
+ return;
+ }
++ if (!bdrv_is_inserted(bs)) {
++ error_setg(errp, "Device has no medium");
++ bdrv_graph_rdunlock_main_loop();
++ return;
++ }
++ bdrv_graph_rdunlock_main_loop();
+
+ target_bs = bdrv_lookup_bs(target, target, errp);
+ if (!target_bs) {
diff --git a/debian/patches/pve/0029-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch b/debian/patches/pve/0029-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch
index 74ce2a426e..ee5a0ba95c 100644
--- a/debian/patches/pve/0029-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch
+++ b/debian/patches/pve/0029-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch
@@ -165,7 +165,7 @@ index 1fd28d59eb..c5c1fcd583 100644
+ hmp_handle_error(mon, error);
+}
diff --git a/blockdev.c b/blockdev.c
-index d9575c8367..38e24e12bd 100644
+index 9da3f5b8bb..3a9f557f5b 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -37,6 +37,7 @@
diff --git a/debian/patches/series b/debian/patches/series
index a93c8eb474..804581193f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -50,6 +50,7 @@ extra/0049-hw-dma-i8257-Return-zeroes-for-read_memory-in-verify.patch
extra/0050-intel_iommu-Correctly-set-pt-bit-in-extended-capabil.patch
extra/0051-intel_iommu-fix-guest-triggerable-abort-on-oversized.patch
extra/0052-backends-rng-cap-request-size-to-avoid-oversized-all.patch
+extra/0053-blockdev-mirror-do-not-require-a-root-block-node.patch
bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch
bitmap-mirror/0002-drive-mirror-add-support-for-conditional-and-always-.patch
bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch
--
2.47.3
next prev parent reply other threads:[~2026-07-24 14:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 14:32 [PATCH-SERIES qemu/qemu-server 0/9] mirror: fix regressions with blockdev and allow migration with 'ro' flag Fiona Ebner
2026-07-24 14:32 ` Fiona Ebner [this message]
2026-07-24 14:32 ` [PATCH qemu-server 2/9] partially fix #7299: fix regression with guest IO limits applying to mirror job Fiona Ebner
2026-07-24 14:32 ` [PATCH qemu-server 3/9] partially fix #7299: migrate: fix regression with guest IO limits applying to NBD export Fiona Ebner
2026-07-24 14:32 ` [PATCH qemu-server 4/9] blockdev: attach: support explicitly attaching as writeable Fiona Ebner
2026-07-24 14:32 ` [PATCH qemu-server 5/9] blockdev: implement reopen function Fiona Ebner
2026-07-24 14:32 ` [PATCH qemu-server 6/9] partially fix #7836: allow mirror for drive with read-only flag when using blockdev Fiona Ebner
2026-07-24 14:32 ` [PATCH qemu-server 7/9] qm: schema: declare 'nbdstop' command as being for internal use only Fiona Ebner
2026-07-24 14:32 ` [PATCH qemu-server 8/9] migrate: log messages from remote nbdstop command Fiona Ebner
2026-07-24 14:32 ` [PATCH qemu-server 9/9] partially fix #7836: allow migration for drive with read-only flag when using blockdev Fiona Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260724143240.211130-2-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.