From 4d1944f2de75c31904030db7302c48401a38842e Mon Sep 17 00:00:00 2001 From: Michal Fox Date: Sat, 3 Oct 2026 01:27:45 +0200 Subject: [PATCH] ui: qemu pci edit: remove the default PCI domain again before saving 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 --- 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 4e8ed74..52f92c2 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'