From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id E841F1FF0E6 for ; Fri, 24 Jul 2026 16:33:35 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id D9ADD21524; Fri, 24 Jul 2026 16:33:17 +0200 (CEST) From: Fiona Ebner 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 Message-ID: <20260724143240.211130-4-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260724143240.211130-1-f.ebner@proxmox.com> References: <20260724143240.211130-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784903533357 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.213 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: MSXR34WMP2EGUW55DGV5KOS3OC3CR2VB X-Message-ID-Hash: MSXR34WMP2EGUW55DGV5KOS3OC3CR2VB X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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