Skip to content

Instantly share code, notes, and snippets.

@turbulentie
Created July 9, 2021 10:57
Show Gist options
  • Save turbulentie/a6732876e2917754bce6c7b242d8bcba to your computer and use it in GitHub Desktop.
Save turbulentie/a6732876e2917754bce6c7b242d8bcba to your computer and use it in GitHub Desktop.
show group of devices for KVM passthrough
#!/bin/bash
# -----------------------------------------------------------------------------
# iommu-group: show group of devices for KVM passthrough
# -----------------------------------------------------------------------------
iommu-group() {
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*};
n=${n%%/*};
printf 'IOMMU Group %s ' "$n";
lspci -nns "${d##*/}";
done;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment