From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 3EC131FF0E1 for ; Mon, 16 Nov 2026 02:01:12 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 0CB20216C2; Mon, 16 Nov 2026 02:01:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794790846; x=1795395646; darn=lists.proxmox.com; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=rZZeamIXGme8KKLeRKmjUFvg9Rgfz6+i21MfmQchvzA=; b=y23yj9EFJsuGWAx+EQir6TDPp18xTUi4quIHnfIXqDoiR6sgmzmrillJ/006IdKNe2 gAwW9IwZL/sZGmMm36jDlOz1ZjD+1CtjnYQ3ZCNwrdq6hnUdiTW3ac2tosnevHBVzdY5 TfW5dx/zZxEkWqxFeQSlhhWccGw4BNnv96SmO5PWrYx+PeCFMC0RbMW0onsXoH7vB84p N1+2lwZskd7ooyUK8wAeO5/jU1rVuecXgaV2QkEnI6xqhb2gaJdcti6jY5BnlKIgw4Bl Y+3uqPIqsehpaPLxBtC5lCaAKv0BEa7DamFCcEqB6ioBRfY5fVA2PYqDK8eK7Foccfv0 Zlkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794790846; x=1795395646; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=rZZeamIXGme8KKLeRKmjUFvg9Rgfz6+i21MfmQchvzA=; b=b0gG7aTo0lb7haPg/l2NUg9s36kYupWSt08geaFJurqSDVmxk4kSJKHcQjnrxzisvY v/gz5hyXBuvsPsh3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YfSSucA59W/ZJjVCOJwyBN0xVEasQFqgQpWBOqOfC3loHYEhVo4= X-Received: by 2002:a67:e711:0:b0:7d2:8999:7393 with SMTP id ada2fe7eead31-7d64d45b10bmr3421243137.2.1794790845482; Sun, 15 Nov 2026 17:00:45 -0800 (PST) From: Lucas Barros To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server/container/manager v2 0/5] fix #7173: do not keep an empty tag list in guest configs Date: Sun, 15 Nov 2026 22:00:35 -0300 Message-ID: <20261116010040.90964-1-lucasbarros.kam@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <1794390075.ol4qipttrq.astroid@yuna.none> References: <1794390075.ol4qipttrq.astroid@yuna.none> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.083 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 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: VJBYUIF474ZUKL5L6NJF26BG7TNVAE7Z X-Message-ID-Hash: VJBYUIF474ZUKL5L6NJF26BG7TNVAE7Z 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 CC: Lucas Barros X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Removing the last tag of a guest leaves an empty 'tags:' line in its config, which the API returns as a tag list with a single space. v1 dropped the empty value when writing the config. Fabian found that hacky [0] and suggested to delete the option instead and to make the parser ignore it. v2 does that: * 1/5, 3/5: the update API turns an empty tag list (checked with split_list(), so delimiters only count as empty too) into a deletion * 2/5, 4/5: the parsers skip an empty 'tags' line, so old configs read as having no tags and lose the line on the next write * 5/5: the web UI sends 'delete: tags' when the last tag is removed I first made the parsers skip every key without a value, but that is not safe in general: * 'boot: ' means that no device gets a boot index, while no 'boot' at all means the default order. The cfg2cmd test bootorder-empty.conf fails with that change. * in qemu-server, update_vm_api() reloads the config between writing a pending change and applying it, so 'qm set --searchdomain ""' on a stopped VM was silently lost. So 2/5 and 4/5 only handle 'tags'. Making empty list parameters invalid for 10.0 is not part of this series. Tested on a PVE 9 node (qemu-server 9.2.15, pve-container 6.1.18, the .pm files patched in place): removing the last tag (VM and CT, via 'tags=' as the UI sends today) before: 'tags: ' line in the config, API returns "tags":" " after: no line, API returns no tags --tags ';,' same as above existing 'tags: ' / 'tags:' before: " " / "unable to parse config" after: no tags, line gone on next write 'tags: a;b', running VM, '--tags "" --delete tags' unchanged 'boot: ', '--searchdomain ""' unchanged qemu-server 'make test' (with 16 CPUs in /proc/cpuinfo): 280 ok before, 282 after, the new parse-config case fails without 2/5. pve-container 'make test' passes before and after, the new subtest fails without 4/5. proxmox-perltidy and proxmox-biome report no changes. v1: https://lore.proxmox.com/pve-devel/20261109135613.94692-1-lucasbarros.kam@gmail.com/ https://lore.proxmox.com/pve-devel/20261109135640.94964-1-lucasbarros.kam@gmail.com/ [0] https://lore.proxmox.com/pve-devel/1794390075.ol4qipttrq.astroid@yuna.none/ This series was prepared with the help of an LLM based coding assistant; I reviewed the changes and ran the tests mentioned above myself. qemu-server: Lucas Barros (2): fix #7173: api: update: delete tags when an empty tag list is set config: ignore an empty tag list when parsing src/PVE/API2/Qemu.pm | 9 +++++++++ src/PVE/QemuServer.pm | 3 +++ src/test/parse-config-expected/empty-tags.conf | 11 +++++++++++ src/test/parse-config-input/empty-tags.conf | 12 ++++++++++++ src/test/run_parse_config_tests.pl | 2 +- 5 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/test/parse-config-expected/empty-tags.conf create mode 100644 src/test/parse-config-input/empty-tags.conf container: Lucas Barros (2): fix #7173: api: update: delete tags when an empty tag list is set config: ignore an empty tag list when parsing src/PVE/API2/LXC/Config.pm | 9 +++++++++ src/PVE/LXC/Config.pm | 3 +++ src/test/config_tests.pl | 21 +++++++++++++++++++++ 3 files changed, 33 insertions(+) manager: Lucas Barros (1): fix #7173: ui: guest: delete tags when removing the last tag www/manager6/lxc/Config.js | 4 +--- www/manager6/qemu/Config.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) Summary over all repositories: 10 files changed, 71 insertions(+), 7 deletions(-)