public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Michal Fox <me@dualfroz.com>
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	[thread overview]
Message-ID: <20261003150751.7-1-me@dualfroz.com> (raw)

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 <me@dualfroz.com>
---
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




                 reply	other threads:[~2026-10-03 15:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261003150751.7-1-me@dualfroz.com \
    --to=me@dualfroz.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal