[PATCH qemu-server 3/3] qm: unlock: add reminder to switch to remove_lock() helper for a major release

Fiona Ebner
2026-04-27T11:23:35Z

For containers, the remove_lock() helper from the AbstractConfig
module is already used. That method dies if no lock was found, while
the current implementation for 'qm unlock' returns success. To avoid
tripping up tooling, delay aligning the behavior between 'qm' and
'pct' to a future major release.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/CLI/qm.pm | 3 +++
1 file changed, 3 insertions(+)

diff --git a/src/PVE/CLI/qm.pm b/src/PVE/CLI/qm.pm
index e64449d7..bc8a086c 100755
--- a/src/PVE/CLI/qm.pm
+++ b/src/PVE/CLI/qm.pm
@@ -391,6 +391,9 @@ __PACKAGE__->register_method({

my $vmid = $param->{vmid};

+ # FIXME: MAJOR VERSION: switch to PVE::QemuConfig->remove_lock() to align behavior with
+ # containers. Note that remove_lock() will die when no lock is found, so that is a change in
+ # behavior.
PVE::QemuConfig->lock_config(
$vmid,
sub {
--
2.47.3