From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 8C8721FF17A for ; Tue, 14 Oct 2025 16:41:05 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 888197BB4; Tue, 14 Oct 2025 16:40:30 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Tue, 14 Oct 2025 16:39:24 +0200 Message-ID: <20251014143946.160679-14-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251014143946.160679-1-f.ebner@proxmox.com> References: <20251014143946.160679-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1760452753029 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.021 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 13/16] blockdev: attach: also return whether attached blockdev is read-only 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" This is in preparation for the qemu-storage-daemon, so that it can apply the same setting for the export. Signed-off-by: Fiona Ebner --- src/PVE/QemuServer/BlockJob.pm | 2 +- src/PVE/QemuServer/Blockdev.pm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PVE/QemuServer/BlockJob.pm b/src/PVE/QemuServer/BlockJob.pm index 506010e1..c89994db 100644 --- a/src/PVE/QemuServer/BlockJob.pm +++ b/src/PVE/QemuServer/BlockJob.pm @@ -480,7 +480,7 @@ sub blockdev_mirror { # Note that if 'aio' is not explicitly set, i.e. default, it can change if source and target # don't both allow or both not allow 'io_uring' as the default. - my $target_node_name = + my ($target_node_name) = PVE::QemuServer::Blockdev::attach($storecfg, $vmid, $dest_drive, $attach_dest_opts); $jobs = {} if !$jobs; diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm index d08a4855..f799c70b 100644 --- a/src/PVE/QemuServer/Blockdev.pm +++ b/src/PVE/QemuServer/Blockdev.pm @@ -528,10 +528,10 @@ my sub blockdev_add { =head3 attach - my $node_name = attach($storecfg, $vmid, $drive, $options); + my ($node_name, $read_only) = attach($storecfg, $vmid, $drive, $options); Attach the drive C<$drive> to the VM C<$vmid> considering the additional options C<$options>. -Returns the node name of the (topmost) attached block device node. +Returns the node name of the (topmost) attached block device node and whether the node is read-only. Parameters: @@ -611,7 +611,7 @@ sub attach { die $err; } - return $blockdev->{'node-name'}; + return ($blockdev->{'node-name'}, $blockdev->{'read-only'}); } =pod -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel