public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server v2] fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM
@ 2023-01-05 14:51 Stefan Hanreich
  2023-01-11 10:02 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Hanreich @ 2023-01-05 14:51 UTC (permalink / raw)
  To: pve-devel

Since we can now differentiate between 'suspended' and 'suspending',
it is possible to ignore the 'suspended' lock when destroying a VM.
It shouldn't matter whether the VM is locked because of hibernation
when you want to remove it. Therefore we can safely ignore the lock.
---

Changes v1 -> v2:
* Improved commit message

After thinking about it for awhile, I'm not sure whether showing a
hint in the UI, when removing a hibernated VM, is that useful. Not sure
why one would have a reason to reconsider removal suddenly in that
case. Maybe someone else has some input/ideas on this?

 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] 2+ messages in thread

* [pve-devel] applied: [PATCH qemu-server v2] fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM
  2023-01-05 14:51 [pve-devel] [PATCH qemu-server v2] fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM Stefan Hanreich
@ 2023-01-11 10:02 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-01-11 10:02 UTC (permalink / raw)
  To: Proxmox VE development discussion, Stefan Hanreich

Am 05/01/2023 um 15:51 schrieb Stefan Hanreich:
> Since we can now differentiate between 'suspended' and 'suspending',
> it is possible to ignore the 'suspended' lock when destroying a VM.
> It shouldn't matter whether the VM is locked because of hibernation
> when you want to remove it. Therefore we can safely ignore the lock.
> ---
> 
> Changes v1 -> v2:
> * Improved commit message
> 
> After thinking about it for awhile, I'm not sure whether showing a
> hint in the UI, when removing a hibernated VM, is that useful. Not sure
> why one would have a reason to reconsider removal suddenly in that
> case. Maybe someone else has some input/ideas on this?

yeah, as said, not a must.

> 
>  PVE/QemuServer.pm | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-11 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 14:51 [pve-devel] [PATCH qemu-server v2] fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM Stefan Hanreich
2023-01-11 10:02 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal