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 468321FF0A8 for ; Sat, 03 Oct 2026 17:08:07 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 8228B216E4; Sat, 03 Oct 2026 17:08:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dualfroz.com; s=dkim; t=1791040077; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding; bh=xJKwFc7VbouqpnzTANkq9t/VtbVCQUARvstvVKhu6f0=; b=EeWYi4C5oKNaF1KZ1RGyoRO2Lm3lw9cm5hZd7vu8Wj7GxNPm4XEkRwAkCrL/KlIKlL+FtY lGX+Uy4cApunlfIiyEw8lGTln3usGrfu6rDKo9+TRjOapSDy1fj1w2NYFJ7goGcRP/E/i7 kEXjadSYvFfJEd5YEaYa4XLdeUoDNGAn3sc8vnowrqDYdfS+5OQFDugXNEvI0Nit2WtsLv zzuInbmjgQ8Bs+ZrkvWlaXbDb1pV/FTkzUluNoOAbVd9kW8oGuOwVsKFtiH2gElO3FHxeI +9OUK3laZmIXYY8dt9Ii565hURbM7L7kEt+XlgwfDzVb9E5FCz3Uzx/MK3E2DQ== From: Michal Fox To: pve-devel@lists.proxmox.com Subject: [PATCH manager] fix #5798: ui: qemu pci edit: fix warning for shared IOMMU groups Date: Sat, 3 Oct 2026 15:07:51 +0000 Message-ID: <20261003150751.7-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.247 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: 74BEQUYB7WNVEXHNXT4S5ZHCBG6SKUID X-Message-ID-Hash: 74BEQUYB7WNVEXHNXT4S5ZHCBG6SKUID 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: When selecting a raw PCI device, a warning should be shown if the device is not in a separate IOMMU group. To not count the other functions of the selected device itself, the check only compares the bus and device part of the PCI IDs, by taking their first five characters. But since the PCI selector also shows the domain, for example '0000:01:00.0', the first five characters are just the domain. So all devices of the same domain were treated as functions of the selected device and the warning was never shown. Compare everything before the function instead, so the domain, bus and device, like the IOMMU check in the PCI mapping editor does. Fixes: f36240c5 ("gui: pci passthrough: consider domain in PCISelector") Signed-off-by: Michal Fox --- Tested by calling pciDevChange with a store where two devices share an IOMMU group: before, the warning was not shown for either of them, now it is, while it is still not shown for a device whose IOMMU group only contains its own functions. www/manager6/qemu/PCIEdit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/manager6/qemu/PCIEdit.js b/www/manager6/qemu/PCIEdit.js index 4e8ed744..3df64372 100644 --- a/www/manager6/qemu/PCIEdit.js +++ b/www/manager6/qemu/PCIEdit.js @@ -83,10 +83,10 @@ Ext.define('PVE.qemu.PCIInputPanel', { return; } // try to find out if there are more devices in that iommu group - let id = path.substring(0, 5); // 00:00 + let id = path.substring(0, path.indexOf('.')); // 0000:00:00 let count = 0; pcisel.getStore().each(({ data }) => { - if (data.iommugroup === iommu && data.id.substring(0, 5) !== id) { + if (data.iommugroup === iommu && !data.id.startsWith(id)) { count++; return false; } -- 2.43.0