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 E1D801FF0DF for ; Thu, 19 Nov 2026 10:29:46 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 1760921423; Thu, 19 Nov 2026 10:29:40 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v6 04/21] ui: parser: qemu network: allow unknown keys Date: Thu, 19 Nov 2026 10:28:17 +0100 Message-ID: <20261119092930.830046-5-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261119092930.830046-1-d.csapak@proxmox.com> References: <20261119092930.830046-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.286 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium 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: LF2IMRDQSVN4QWWU3HAXEN6TIFF3TGAG X-Message-ID-Hash: LF2IMRDQSVN4QWWU3HAXEN6TIFF3TGAG X-MailFrom: d.csapak@proxmox.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: The backend often gets new options for nics, and the gui does not always keep up, so parse unknown options too so the parser does not break as a whole, just for one unknown key. Do this instead of adding all known keys, since we can already assume that only valid values are returned from the api. To not lose those unknown keys on an edit cycle, we also have to print them out again when using printQemuNetwork. This brings the network parser more inline with the drive parser, which has a similar logic. Signed-off-by: Dominik Csapak --- www/manager6/Parser.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/www/manager6/Parser.js b/www/manager6/Parser.js index a82b3d3d..bdd4fed5 100644 --- a/www/manager6/Parser.js +++ b/www/manager6/Parser.js @@ -142,6 +142,8 @@ Ext.define('PVE.Parser', { res.trunks = match_res[1]; } else if ((match_res = p.match(/^mtu=(\d+)$/)) !== null) { res.mtu = match_res[1]; + } else if ((match_res = p.match(/^([^=]+)=(.+)$/)) !== null) { + res[match_res[1]] = match_res[2]; } else { errors = true; return false; // break @@ -170,21 +172,22 @@ Ext.define('PVE.Parser', { netstr += ',firewall=' + net.firewall; } } - if (net.rate) { - netstr += ',rate=' + net.rate; - } - if (net.queues) { - netstr += ',queues=' + net.queues; - } if (net.disconnect) { netstr += ',link_down=' + net.disconnect; } - if (net.trunks) { - netstr += ',trunks=' + net.trunks; - } - if (net.mtu) { - netstr += ',mtu=' + net.mtu; + delete net.model; + delete net.macaddr; + delete net.bridge; + delete net.tag; + delete net.firewall; + delete net.disconnect; + + for (const [key, value] of Object.entries(net)) { + if (value !== undefined) { + netstr += `,${key}=${value}`; + } } + return netstr; }, -- 2.47.3