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 540641FF183 for ; Wed, 17 Dec 2025 14:17:14 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EDAD523E6; Wed, 17 Dec 2025 14:18:01 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Wed, 17 Dec 2025 14:17:12 +0100 Message-ID: <20251217131724.118681-4-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251217131724.118681-1-f.ebner@proxmox.com> References: <20251217131724.118681-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1765977438777 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 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 Subject: [pve-devel] [PATCH qemu-server 3/3] dbus-vmstate: guard more errors in qemu_del_dbus_vmstate() 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" Before commit "systemd: vmid.scope: add orderings to fix dbus-vmstate cleanup (regression)", an issue with hard errors during cleanup of the dbus-vmstate surfaced if the dbus.service was already not running. In particular, the Net::DBus->system() call would fail when the dbus.service is not running. Guard errors there and for the get_bus_object() call, like other errors in qemu_del_dbus_vmstate() already are guarded. Do not honor the 'quiet' option for these and log failures in any case, because not having a working system DBus is a more fundamental failure than the other failure scenarios in the function and should still be recorded. Signed-off-by: Fiona Ebner --- src/PVE/QemuServer/DBusVMState.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/PVE/QemuServer/DBusVMState.pm b/src/PVE/QemuServer/DBusVMState.pm index 480d9f70..3b5fe301 100644 --- a/src/PVE/QemuServer/DBusVMState.pm +++ b/src/PVE/QemuServer/DBusVMState.pm @@ -82,8 +82,19 @@ sub qemu_del_dbus_vmstate { my ($vmid, %params) = @_; my $num_entries = undef; - my $dbus = Net::DBus->system(); - my $dbus_obj = $dbus->get_bus_object(); + my $dbus = eval { Net::DBus->system(); }; + if (my $err = $@) { + # log fundamental error even if $params{quiet} is set + syslog('warn', "failed to connect to DBus system bus: $err"); + return undef; + } + + my $dbus_obj = eval { $dbus->get_bus_object(); }; + if (my $err = $@) { + # log fundamental error even if $params{quiet} is set + syslog('warn', "failed to get DBus bus object: $err"); + return undef; + } my $owners = eval { $dbus_obj->ListQueuedOwners('org.qemu.VMState1') }; if (my $err = $@) { -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel