From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 4FA0A1FF09B for ; Mon, 09 Nov 2026 15:25:50 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 6188720267; Mon, 09 Nov 2026 15:25:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794234333; x=1794839133; darn=lists.proxmox.com; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=NeSJQ00m5oRTy/CSYrBnHFoF8PG47Nx+9fChRjHRyUw=; b=idR67RpJxoNFjIoZqAYFXBqGWVrf9UG62HlrKJXRqlkABxe9oL/jgAKn7TSajo42l+ 9ULjrAHtqTQwX5itr6kcC+ozQLQuvdzyd9uDq6nedndB3CVmxkqnoQKHMsKIYwvCk/c6 Z392DRVoIMtYitY2EGvwA3yfvwCOB4cbkdJvuNaStpdHCWIEwC7jB9faPRqfS3h7xU8f biqnc4GsHiNcLj3w8HqrVXQrlaOy0CqkMGEkEcM4QWqDYQQQqX3I0O+1ilSlZx19Q1Hc UGeNtWeK4/08OzK2rovbU2+tfibNLlbwn30aVOE+gUETR/OdZeOa/3tD4rlwWNJPfKO/ K9iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794234333; x=1794839133; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=NeSJQ00m5oRTy/CSYrBnHFoF8PG47Nx+9fChRjHRyUw=; b=Dz2MH0DXXoJewwFWQuklm7iWL1uxbBlVD11j1lKcfUALH1eV3WkhwIALzmGdBJc/bj gB7JKFQz67zxnc7ZVZQory0JoMAD9C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+KH4pNWA== X-Received: by 2002:a05:6122:1dab:b0:5ec:d70c:633a with SMTP id 71dfb90a1353d-5ece720ebacmr1428773e0c.6.1794234333009; Mon, 09 Nov 2026 06:25:33 -0800 (PST) From: Lucas Barros To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server] fix #8120: config: allow 'import' lock in the schema Date: Mon, 9 Nov 2026 11:25:27 -0300 Message-ID: <20261109142527.23497-1-lucasbarros.kam@gmail.com> X-Mailer: git-send-email 2.50.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.037 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: BEG2JFP4WSKWQRNYREILDQCENNUY6WN5 X-Message-ID-Hash: BEG2JFP4WSKWQRNYREILDQCENNUY6WN5 X-MailFrom: lucasbarros.kam@gmail.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: A live import ('import-from' with 'live-restore', for example from the ESXi import wizard) sets 'lock: import' on the new VM until the import is done, but 'import' is not part of the enumeration of the 'lock' property. Reading such a config through the API works, but every consumer that verifies the result against the schema fails, most prominently 'qm config', which exits with: 400 Result verification failed lock: value 'import' does not have a value in the enumeration ... This holds for the whole duration of the import, and also afterwards if it failed or was aborted, as the lock is only removed on success. Add 'import' to the allowed values, so that the lock is reported like any other one. Signed-off-by: Lucas Barros --- Tested on a PVE 9 node (qemu-server 9.2.15), with a real live import from a local raw image and with the lock set by hand: before: $ qm create 9904 --name live-test --memory 256 --live-restore 1 \ --scsi0 local:0,import-from=/root/src.raw & $ grep '^lock' /etc/pve/qemu-server/9904.conf lock: import $ qm config 9904; echo "exit=$?" 400 Result verification failed lock: value 'import' does not have a value in the enumeration 'backup, clone, create, migrate, rollback, snapshot, snapshot-delete, suspending, suspended' qm config [OPTIONS] exit=255 ('qm config --current' fails the same way, while 'pvesh get /nodes//qemu//config' shows "lock":"import") after: $ qm config 9904; echo "exit=$?" boot: order=scsi0 lock: import ... exit=0 The live import itself finishes and removes the lock as before. As mentioned in the report, 'import' can now also be passed to 'qm set --lock', like the other lock values. A VM locked that way refuses to start ("VM is locked (import)") and 'qm unlock' removes it again. Apart from the schema checks, I did not find code that depends on the list of lock values. The 'destroyed' lock that destroy_vm() writes is missing from the enumeration as well (pve-container has it), but that config only exists for a short moment, so I left it out here. The parse-config tests do not verify the property values, so I did not add a test case there. 'make test' passes before and after. proxmox-perltidy reports no changes; the enumeration needed to be split into two qw() lists to stay within 100 columns. This patch was prepared with the help of an LLM based coding assistant; I reviewed the change and ran the tests mentioned above myself. src/PVE/QemuServer.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index 8045c07e..8eb98fbd 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -274,7 +274,9 @@ my $confdesc = { type => 'string', description => "Lock/unlock the VM.", enum => [ - qw(backup clone create migrate rollback snapshot snapshot-delete suspending suspended)], + qw(backup clone create import migrate rollback snapshot snapshot-delete), + qw(suspending suspended), + ], }, cpulimit => { optional => 1, -- 2.47.3