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 6815E1FF16B for ; Tue, 12 Aug 2025 13:55:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D87B1B9F1; Tue, 12 Aug 2025 13:57:28 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Tue, 12 Aug 2025 13:56:30 +0200 Message-ID: <20250812115652.79330-3-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250812115652.79330-1-f.ebner@proxmox.com> References: <20250812115652.79330-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1754999785140 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.025 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [blockdev.pm] Subject: [pve-devel] [PATCH qemu-server v2 2/3] blockdev: attach/detach: silence errors for QMP commands for which failure may be expected 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" Without passing 'noerr' to mon_cmd(), errors are logged to the system journal. In attach() and detach(), there are two mon_cmd() calls that are expected to fail in some scenarios for which the errors should not be logged. Reported-by: Friedrich Weber Signed-off-by: Fiona Ebner --- src/PVE/QemuServer/Blockdev.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PVE/QemuServer/Blockdev.pm b/src/PVE/QemuServer/Blockdev.pm index d0d7e684..04eeed3c 100644 --- a/src/PVE/QemuServer/Blockdev.pm +++ b/src/PVE/QemuServer/Blockdev.pm @@ -575,7 +575,7 @@ sub attach { eval { if ($throttle_group_id) { # Try to remove potential left-over. - eval { mon_cmd($vmid, 'object-del', id => $throttle_group_id); }; + mon_cmd($vmid, 'object-del', id => $throttle_group_id, noerr => 1); my $throttle_group = generate_throttle_group($drive); mon_cmd($vmid, 'object-add', $throttle_group->%*); @@ -630,8 +630,8 @@ sub detach { while ($node_name) { last if !$block_info->{$node_name}; # already gone - eval { mon_cmd($vmid, 'blockdev-del', 'node-name' => "$node_name"); }; - if (my $err = $@) { + my $res = mon_cmd($vmid, 'blockdev-del', 'node-name' => "$node_name", noerr => 1); + if (my $err = $res->{error}) { last if $err =~ m/Failed to find node with node-name/; # already gone die "deleting blockdev '$node_name' failed : $err\n"; } -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel