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 A9A161FF14C for ; Fri, 15 May 2026 12:09:18 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7F73317907; Fri, 15 May 2026 12:09:18 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v4 0/3] improve guest cleanup handling Date: Fri, 15 May 2026 12:04:51 +0200 Message-ID: <20260515100842.1980636-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.050 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: N2GVW2BELAZVMNCW7SXHF2OQS6ZI5DA6 X-Message-ID-Hash: N2GVW2BELAZVMNCW7SXHF2OQS6ZI5DA6 X-MailFrom: d.csapak@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: First we make the cleanup handling more consistent (1/3) then we check explicitely for the backup lock to improve the error message for stop backup mode (2/3) and then we fix #7119 by waiting up to 30s for a possibly still running guest to stop (e.g. this can occur when using usb passthrouh) (3/3) changes from v3: * update version in preinst check * add #DEBHELPER# to preinst * consistently use /run/ instead of /var/run * make get_cleanup_flag_path public and use that for mocking in tests * style fixes * use non-deprecated is_running helper * improve warning message changes from v2/RFC: * use 'vm_running_locally' for getting the pid * improve error messages * use a 'use_old_cleanup' flag that will be auto-removed by a reboot to signal if we can use the new cleanup logic or the old Dominik Csapak (3): cleanup: refactor to make cleanup flow consistent qm cleanup: die early when encountering a running stop mode backup fix #7119: qm cleanup: wait for process exiting for up to 30 seconds debian/preinst | 18 +++++++++++++++ src/PVE/CLI/qm.pm | 39 ++++++++++++++++++++++++++++---- src/PVE/QemuServer.pm | 14 ++++++++++++ src/PVE/QemuServer/RunState.pm | 29 ++++++++++++++++++++++++ src/test/MigrationTest/QmMock.pm | 11 +++++++++ 5 files changed, 106 insertions(+), 5 deletions(-) create mode 100755 debian/preinst -- 2.47.3