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 C13C11FF183 for ; Wed, 3 Dec 2025 14:30:22 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A6DA79F00; Wed, 3 Dec 2025 14:30:06 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Wed, 3 Dec 2025 14:26:42 +0100 Message-ID: <20251203132949.109685-17-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251203132949.109685-1-f.ebner@proxmox.com> References: <20251203132949.109685-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1764768549313 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.017 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 Subject: [pve-devel] [PATCH qemu-server 16/18] blockdev: switch blockdev_commit() to use QMP peer X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Signed-off-by: Fiona Ebner --- src/PVE/QemuServer.pm | 2 +- src/PVE/QemuServer/Blockdev.pm | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index 76f585fb..d021dac6 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -4447,7 +4447,7 @@ sub qemu_volume_snapshot_delete { print "delete first snapshot $snap\n"; PVE::QemuServer::Blockdev::blockdev_commit( $storecfg, - $vmid, + vm_qmp_peer($vmid), $machine_version, $attached_deviceid, $drive, diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm index 569b8fd3..6566e9ac 100644 --- a/src/PVE/QemuServer/Blockdev.pm +++ b/src/PVE/QemuServer/Blockdev.pm @@ -1027,7 +1027,7 @@ sub blockdev_replace { } sub blockdev_commit { - my ($storecfg, $vmid, $machine_version, $deviceid, $drive, $src_snap, $target_snap) = @_; + my ($storecfg, $qmp_peer, $machine_version, $deviceid, $drive, $src_snap, $target_snap) = @_; my $volid = $drive->{file}; my $target_was_read_only; @@ -1064,7 +1064,7 @@ sub blockdev_commit { print "reopening internal read-only block node for '$target_snap' as writable\n"; $target_fmt_blockdev->{'read-only'} = JSON::false; $target_file_blockdev->{'read-only'} = JSON::false; - mon_cmd($vmid, 'blockdev-reopen', options => [$target_fmt_blockdev]); + qmp_cmd($qmp_peer, 'blockdev-reopen', options => [$target_fmt_blockdev]); # For the guest, the drive is still read-only, because the top throttle node is. } @@ -1076,7 +1076,7 @@ sub blockdev_commit { $opts->{'base-node'} = $target_fmt_blockdev->{'node-name'}; $opts->{'top-node'} = $src_fmt_blockdev->{'node-name'}; - mon_cmd($vmid, "block-commit", %$opts); + qmp_cmd($qmp_peer, "block-commit", %$opts); $jobs->{$job_id} = {}; # if we commit the current, the blockjob need to be in 'complete' mode @@ -1084,7 +1084,7 @@ sub blockdev_commit { eval { PVE::QemuServer::BlockJob::qemu_drive_mirror_monitor( - vm_qmp_peer($vmid), undef, $jobs, $complete, 0, 'commit', + $qmp_peer, undef, $jobs, $complete, 0, 'commit', ); }; if ($@) { @@ -1092,12 +1092,7 @@ sub blockdev_commit { } 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, ); }; my $err = $@; @@ -1108,7 +1103,7 @@ sub blockdev_commit { print "re-applying read-only flag for internal block node for '$target_snap'\n"; $target_fmt_blockdev->{'read-only'} = JSON::true; $target_file_blockdev->{'read-only'} = JSON::true; - eval { mon_cmd($vmid, 'blockdev-reopen', options => [$target_fmt_blockdev]); }; + eval { qmp_cmd($qmp_peer, 'blockdev-reopen', options => [$target_fmt_blockdev]); }; print "failed to re-apply read-only flag - $@\n" if $@; } -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel