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 399F81FF0AD for ; Sun, 04 Oct 2026 18:34:43 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 4E09E215FC; Sun, 04 Oct 2026 18:34:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dualfroz.com; s=dkim; t=1791131664; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding; bh=CKEMvcBzpS6rcfe64nBcFyohJMKe4SHB9KCTcLiuFk4=; b=aV/GJhOTUZ6WKMQ/dbSfuKy5hdMoRi9lzPgwbSDTr+qZ99tTRfN8qR9xpyhcwxSlwFG1Ms fAofFjHi0UJxu+LJTpytR0KUWQEUm7mJ1ag5gvIwDjc9DM7VMoUoZDACMM2HotKqwIkUE+ f7Ii0yHTheO7vjTWd352w+ZMcImHey83nQw8iYAHTUPwdySn1bOsQZ+puRTqfpXmxEW36i R4X28A+IJM0wgyLjjDyBcSv1AzH1RUlcFBwx815pUpAGdKtEHg4tJaKQ15JUrklwigFhje b8yfRQ9HYmAfpdWhSP5VbZBxxB17IF8HXT1YMX5RIWs2f3DJ4vU0IXBjICKwOQ== From: Michal Fox To: pve-devel@lists.proxmox.com Subject: [PATCH manager] ui: qemu pci edit: remove the default PCI domain again before saving Date: Sun, 4 Oct 2026 16:34:19 +0000 Message-ID: <20261004163419.6-1-me@dualfroz.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.167 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 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: W2QD2MSUAVIICE7CZUJILHFUSTBF7PWY X-Message-ID-Hash: W2QD2MSUAVIICE7CZUJILHFUSTBF7PWY X-MailFrom: me@dualfroz.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 PCI selector shows the IDs of the devices including the domain, so the default '0000' domain was removed again before saving, as it is optional in the hostpci option. Since the refactoring in commit a7ec3666 ("ui: qemu/PCI Edit: code cleanup/refactoring/modernize"), the result of the replace call is not assigned anymore, so the domain is kept and a device that was configured as '01:00.0' gets saved as '0000:01:00.0' on any edit of the passthrough device. Assign the result again, so the domain is only kept if it is not the default one, like before. Fixes: a7ec3666 ("ui: qemu/PCI Edit: code cleanup/refactoring/modernize") Signed-off-by: Michal Fox --- Tested in the browser with the PCI edit window and mocked configs: 'hostpci0: 01:00.0' is saved as '01:00.0' again instead of '0000:01:00.0', while a device in another domain like '0001:02:00.0' and mapped devices are saved as before. www/manager6/qemu/PCIEdit.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/manager6/qemu/PCIEdit.js b/www/manager6/qemu/PCIEdit.js index 4e8ed744..52f92c27 100644 --- a/www/manager6/qemu/PCIEdit.js +++ b/www/manager6/qemu/PCIEdit.js @@ -109,7 +109,9 @@ Ext.define('PVE.qemu.PCIInputPanel', { // FIXME: what if no confid was found?? } - values.host?.replace(/^0000:/, ''); // remove optional '0000' domain + if (values.host) { + values.host = values.host.replace(/^0000:/, ''); // remove optional '0000' domain + } if (values.multifunction && values.host) { values.host = values.host.substring(0, values.host.indexOf('.')); // skip the '.X' -- 2.43.0