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 5FE471FF13A for ; Wed, 13 May 2026 17:09:51 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3C433146A0; Wed, 13 May 2026 17:09:51 +0200 (CEST) Message-ID: Date: Wed, 13 May 2026 17:08:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH qemu-server v3 2/3] qm cleanup: die early when encountering a running stop mode backup To: Dominik Csapak , pve-devel@lists.proxmox.com References: <20260226140752.1792378-1-d.csapak@proxmox.com> <20260226140752.1792378-3-d.csapak@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20260226140752.1792378-3-d.csapak@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778684895651 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.009 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qm.pm] Message-ID-Hash: OTNYD3L4323SOIRXBOJXWI3USHJ64J4I X-Message-ID-Hash: OTNYD3L4323SOIRXBOJXWI3USHJ64J4I X-MailFrom: f.ebner@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: Am 26.02.26 um 3:07 PM schrieb Dominik Csapak: > this is an expected situation, so abort here early with a better message > than 'vm still running' > > Signed-off-by: Dominik Csapak Reviewed-by: Fiona Ebner with one nit below > --- > src/PVE/CLI/qm.pm | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/src/PVE/CLI/qm.pm b/src/PVE/CLI/qm.pm > index b7bc4d9f..6aff5b7a 100755 > --- a/src/PVE/CLI/qm.pm > +++ b/src/PVE/CLI/qm.pm > @@ -1102,6 +1102,13 @@ __PACKAGE__->register_method({ > sub { > my $conf = PVE::QemuConfig->load_config($vmid); > my $pid = PVE::QemuServer::check_running($vmid); > + > + # With a stop mode backup, we might run here into a running vm with a backup > + # lock, but this already did the cleanup and is an expected state, so abort > + # here with a good message > + die "skipping cleanup - 'backup' lock is present and vm is running again\n" > + if $pid && $clean && $conf->{lock} && $conf->{lock} eq 'backup'; > + > die "vm still running\n" if $pid; Nit: both could be grouped inside an if ($pid) branch for slightly improved clarity > > # Rollback already does cleanup when preparing and afterwards temporarily drops the