From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server 3/9] partially fix #7299: migrate: fix regression with guest IO limits applying to NBD export
Date: Fri, 24 Jul 2026 16:32:24 +0200 [thread overview]
Message-ID: <20260724143240.211130-4-f.ebner@proxmox.com> (raw)
In-Reply-To: <20260724143240.211130-1-f.ebner@proxmox.com>
Related to commit "partially fix #7299: fix regression with guest IO
limits applying to mirror job", but taking care of the NBD export on
the target side. Since the switch to -blockdev with version 10.0,
write limits intended for the guest would apply to NBD exports as
well. This is because the top throttle node was exported. Export the
node below instead to avoid the issue.
For the test, change to using the version of query-block from
the MigrationTest::Shared module to make it work.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer.pm | 13 ++++++++++++-
src/test/MigrationTest/QmMock.pm | 7 -------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 9aec7f9c..6b03e170 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -5929,7 +5929,18 @@ sub vm_start_nolock {
my $drivestr = $nbd->{$opt}->{drivestr};
my $volid = $nbd->{$opt}->{volid};
- my $block_node = $block_info->{$opt}->{inserted}->{'node-name'};
+ my $top = $block_info->{$opt}->{inserted};
+ die "no block node found for drive '$opt'\n" if !$top;
+ my $block_node = $top->{'node-name'};
+ my $machine_type = PVE::QemuServer::Machine::get_current_qemu_machine($vmid);
+ if (PVE::QemuServer::Machine::is_machine_version_at_least($machine_type, 10, 0)) {
+ # Since the switch to -blockdev with machine version 10, the top node is a throttle
+ # node. Use the node below it to avoid the guest limits applying to the NBD export.
+ die "top node for drive '$opt' is not a throttle node" if $top->{drv} ne 'throttle';
+ my $children = { map { $_->{child} => $_ } $top->{children}->@* };
+ $block_node = $children->{file}->{'node-name'}
+ or die "drive '$opt': throttle node without file child node name\n";
+ }
mon_cmd(
$vmid,
diff --git a/src/test/MigrationTest/QmMock.pm b/src/test/MigrationTest/QmMock.pm
index 8f8899dc..aa5fac4f 100644
--- a/src/test/MigrationTest/QmMock.pm
+++ b/src/test/MigrationTest/QmMock.pm
@@ -50,8 +50,6 @@ my sub mocked_mon_cmd {
return;
} elsif ($command eq 'block-export-add') {
return;
- } elsif ($command eq 'query-block') {
- return [];
} elsif ($command eq 'qom-set') {
return;
} elsif ($command eq 'query-version') {
@@ -70,11 +68,6 @@ $inotify_module->mock(
},
);
-my $qemu_server_blockdev_module = Test::MockModule->new("PVE::QemuServer::Blockdev");
-$qemu_server_blockdev_module->mock(
- mon_cmd => \&mocked_mon_cmd,
-);
-
my $qemu_server_helpers_module = Test::MockModule->new("PVE::QemuServer::Helpers");
$qemu_server_helpers_module->mock(
vm_running_locally => sub {
--
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 ` [PATCH qemu 1/9] add patch to allow mirror job to use non-root block node Fiona Ebner
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 ` Fiona Ebner [this message]
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-4-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox