From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 87DC71FF296 for ; Fri, 24 Apr 2026 14:19:31 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4823F1845B; Fri, 24 Apr 2026 14:09:30 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 24 Apr 2026 14:09:26 +0200 Message-Id: Subject: Re: [PATCH qemu-server v3 16/18] blockdev: switch blockdev_commit() to use QMP peer From: "Lukas Sichert" To: "Fiona Ebner" , References: <20260423093753.43199-1-f.ebner@proxmox.com> <20260423093753.43199-17-f.ebner@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1777032475757 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.643 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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: HDV7E3MHKEXJJD6JEWPT6JAV3UDG6WD7 X-Message-ID-Hash: HDV7E3MHKEXJJD6JEWPT6JAV3UDG6WD7 X-MailFrom: l.sichert@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: On 2026-04-24 13:56, Fiona Ebner wrote: > Am 24.04.26 um 1:47 PM schrieb Lukas Sichert: >>> diff --git a/src/PVE/QemuServer/VolumeChain.pm b/src/PVE/QemuServer/Vol= umeChain.pm >>> index dad39479..91e78495 100644 >>> --- a/src/PVE/QemuServer/VolumeChain.pm >>> +++ b/src/PVE/QemuServer/VolumeChain.pm >>> @@ -192,7 +192,7 @@ sub blockdev_replace { >>> } >>> =20 >>> sub blockdev_commit { >>> - my ($storecfg, $vmid, $machine_version, $deviceid, $drive, $src_sn= ap, $target_snap) =3D @_; >>> + my ($storecfg, $qmp_peer, $machine_version, $deviceid, $drive, $sr= c_snap, $target_snap) =3D @_; >>> =20 >>> my $volid =3D $drive->{file}; >>> my $target_was_read_only; >>> @@ -229,7 +229,7 @@ sub blockdev_commit { >>> print "reopening internal read-only block node for '$target_sn= ap' as writable\n"; >>> $target_fmt_blockdev->{'read-only'} =3D JSON::false; >>> $target_file_blockdev->{'read-only'} =3D JSON::false; >>> - mon_cmd($vmid, 'blockdev-reopen', options =3D> [$target_fmt_bl= ockdev]); >>> + qmp_cmd($qmp_peer, 'blockdev-reopen', options =3D> [$target_fm= t_blockdev]); >>> # For the guest, the drive is still read-only, because the top= throttle node is. >>> } >>> =20 >>> @@ -241,7 +241,7 @@ sub blockdev_commit { >>> $opts->{'base-node'} =3D $target_fmt_blockdev->{'node-name'}; >>> $opts->{'top-node'} =3D $src_fmt_blockdev->{'node-name'}; >>> =20 >>> - mon_cmd($vmid, "block-commit", %$opts); >>> + qmp_cmd($qmp_peer, "block-commit", %$opts); >>> $jobs->{$job_id} =3D {}; >>> =20 >>> # If the 'current' state is committed to its backing snapshot,= the job will not complete >>> @@ -255,17 +255,10 @@ sub blockdev_commit { >>> # 'block-commit' will complete automatically. >>> my $complete =3D $src_snap && $src_snap ne 'current' ? 'auto' = : 'complete'; >>> =20 >>> - PVE::QemuServer::BlockJob::monitor( >>> - vm_qmp_peer($vmid), undef, $jobs, $complete, 0, 'commit', >>> - ); >>> + PVE::QemuServer::BlockJob::monitor($qmp_peer, undef, $jobs, $c= omplete, 0, 'commit'); >> Similar to [1], but not as obvious. 'vm_qmp_peer' just got added in this >> series. >>> =20 >>> blockdev_delete( >>> - $storecfg, >>> - vm_qmp_peer($vmid), >>> - $drive, >>> - $src_file_blockdev, >>> - $src_fmt_blockdev, >>> - $src_snap, >>> + $storecfg, $qmp_peer, $drive, $src_file_blockdev, $src_fmt= _blockdev, $src_snap, >>> ); >>> }; >> Same as above. > > But patch 09/18 "blockdev: switch blockdev_replace() to use QMP peer" > already adds an import for vm_qmp_peer and patches 13/18 "block job: > switch qemu_drive_mirror_monitor() to use QMP peer" and 14/18 "blockdev: > switch blockdev_delete() to use QMP peer" switched the functions to > support having a QMP peer already, so what is the issue? You are right. I had assumed it was possible to switch from '$vmid' directly to 'qmp_peer', which is not really applicable. Sorry for the noise.