From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 3472C1FF0B3 for ; Wed, 11 Nov 2026 13:02:41 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 21A762169D; Wed, 11 Nov 2026 13:02:21 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v2 3/9] partially fix #7299: migrate: fix regression with guest IO limits applying to NBD export Date: Wed, 11 Nov 2026 13:01:42 +0100 Message-ID: <20261111120211.110737-4-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261111120211.110737-1-f.ebner@proxmox.com> References: <20261111120211.110737-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: 1794398534739 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.282 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_MED -2.3 Sender listed at https://www.dnswl.org/, medium 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: SKJ74HBAUZWK7GXTP3KLXJ3D5YXJ6TER X-Message-ID-Hash: SKJ74HBAUZWK7GXTP3KLXJ3D5YXJ6TER 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 --- No changes in v2. 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 8149184e..1f7cc79e 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -5819,7 +5819,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