From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Stefan Hanreich <s.hanreich@proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server] fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM
Date: Tue, 3 Jan 2023 16:43:21 +0100 [thread overview]
Message-ID: <0b962a8c-9b6c-d2f9-f515-322919381baa@proxmox.com> (raw)
In-Reply-To: <20230103144501.1103523-1-s.hanreich@proxmox.com>
Am 03/01/2023 um 15:45 schrieb Stefan Hanreich:
> Since there is not really a reason why hibernated VMs shouldn't be
IMO the key that this is safe is that there's now (well since quite a while)
two locks so that going into suspension and being actually suspended can be
differentiated via the `suspending` (not safe) and `suspended` (safe) locks.
Maybe that could be worked in the commit message (could do son on applying it)
> able to be removed, we can safely ignore the 'suspended' lock in
> destroy_vm.
Is the saved VM state then actually cleaned up?
Maybe a extra hint for such things in the web UI could be nice, but
must not necessarily be tied to this patch (series).
>
> Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
> ---
> PVE/QemuServer.pm | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 39fc6b0..5dae168 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -2341,7 +2341,9 @@ sub destroy_vm {
>
> my $conf = PVE::QemuConfig->load_config($vmid);
>
> - PVE::QemuConfig->check_lock($conf) if !$skiplock;
> + if (!$skiplock && !PVE::QemuConfig->has_lock($conf, 'suspended')) {
> + PVE::QemuConfig->check_lock($conf);
> + }
>
> if ($conf->{template}) {
> # check if any base image is still used by a linked clone
next prev parent reply other threads:[~2023-01-03 15:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 14:45 Stefan Hanreich
2023-01-03 15:43 ` Thomas Lamprecht [this message]
2023-01-03 15:52 ` Stefan Hanreich
2023-01-03 16:10 ` Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0b962a8c-9b6c-d2f9-f515-322919381baa@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=s.hanreich@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox