* [pve-devel] [PATCH qemu-server] fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM
@ 2023-01-03 14:45 Stefan Hanreich
2023-01-03 15:43 ` Thomas Lamprecht
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Hanreich @ 2023-01-03 14:45 UTC (permalink / raw)
To: pve-devel
Since there is not really a reason why hibernated VMs shouldn't be
able to be removed, we can safely ignore the 'suspended' lock in
destroy_vm.
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
--
2.30.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [PATCH qemu-server] fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM
2023-01-03 14:45 [pve-devel] [PATCH qemu-server] fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM Stefan Hanreich
@ 2023-01-03 15:43 ` Thomas Lamprecht
2023-01-03 15:52 ` Stefan Hanreich
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Lamprecht @ 2023-01-03 15:43 UTC (permalink / raw)
To: Proxmox VE development discussion, Stefan Hanreich
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [PATCH qemu-server] fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM
2023-01-03 15:43 ` Thomas Lamprecht
@ 2023-01-03 15:52 ` Stefan Hanreich
2023-01-03 16:10 ` Thomas Lamprecht
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Hanreich @ 2023-01-03 15:52 UTC (permalink / raw)
To: Thomas Lamprecht, Proxmox VE development discussion
On 1/3/23 16:43, Thomas Lamprecht wrote:
> 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?
Yes, I just (double-)checked. Both disk image and suspended state get
removed.
>
> Maybe a extra hint for such things in the web UI could be nice, but
> must not necessarily be tied to this patch (series).
Should not be too hard to add, I'll make a v2 with the proposed changes
to the commit message?
>
>>
>> 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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [PATCH qemu-server] fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM
2023-01-03 15:52 ` Stefan Hanreich
@ 2023-01-03 16:10 ` Thomas Lamprecht
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2023-01-03 16:10 UTC (permalink / raw)
To: Proxmox VE development discussion, Stefan Hanreich
Am 03/01/2023 um 16:52 schrieb Stefan Hanreich:
>
> Yes, I just (double-)checked. Both disk image and suspended state get removed.
>
>>
>> Maybe a extra hint for such things in the web UI could be nice, but
>> must not necessarily be tied to this patch (series).
>
> Should not be too hard to add, I'll make a v2 with the proposed changes to the commit message?
Fine for me, note that I threw the idea of the hint mostly just out there,
so don't just do it because I asked for it ^^
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-01-03 16:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-03 14:45 [pve-devel] [PATCH qemu-server] fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM Stefan Hanreich
2023-01-03 15:43 ` Thomas Lamprecht
2023-01-03 15:52 ` Stefan Hanreich
2023-01-03 16:10 ` Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox