Skip to content

Commit 76777c4

Browse files
author
Jared Johnstone
committed
Added flag: -iommugroups to color-print iommu groups then exit.
1 parent 9e38919 commit 76777c4

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ This example would catch any:
143143

144144
3. A PCI device with ID `10ec:8168`.
145145

146-
`-taskset 0,1,2,3,4,5` / `-taskset 0,2,4,8`
146+
`-taskset 0,1,2,3,4,5` / `-taskset 0,2,4,8`
147147

148148
The taskset argument will take the threads you give it and only lets the VM execute on those threads. It also creates only that many threads on the VM. (6 and 4 in the examples respectively)
149149
This can significantly reduce latency if the guestis having trouble, even if you haven't configured any host pinning.
@@ -157,6 +157,10 @@ This example would catch any:
157157

158158
A quick terminal color test then exits.
159159

160+
`-iommugroups` / `-iommugrouping`
161+
162+
Prints IOMMU groupings if available then exists.
163+
160164
## Notes and Gotchas.
161165
- If you don't set any `-usb` or `-pci` arguments the VM will run in a window on your desktop as is normal for Qemu. Useful for testing the VM actually boots, installing OSes or using liveCDs.
162166
- The absolute minimum requirement to get started is the `-image` and `-iso` arguments with OVMF available. You can install an OS, VirtIO+Nvidia drivers if needed, and have it ready for a passthrough on the next boot.

main

+8-2
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,16 @@ while [ $# -gt 0 ]
310310
do
311311
case "$1" in
312312
-colortest|-colourtest)
313-
echo "Ok, doing a color test then exiting..."
313+
echo -e "${colors[green]}Ok, printing a color test then exiting...${colors[white]}"
314314
for i in $(sort <<< ${!colors[@]}) ; do echo -e "Test for: ${colors[$i]}$i ${colors[white]}" ; done
315-
exit 0
315+
exit $?
316316
;;
317+
-iommugroups|-iommugrouping)
318+
echo -e "${colors[green]}Ok, printing IOMMU Groups then exiting...${colors[white]}"
319+
iommuDir="/sys/kernel/iommu_groups";
320+
if [ -d $iommuDir ]; then for g in `ls -1v $iommuDir`; do echo "IOMMU Group $g"; for d in $iommuDir/$g/devices/* ; do echo -e "${colors[cyan]}\t$(lspci -nns ${d##*/})${colors[white]}"; done; done ; else echo "Couldn't find $iommuDir" ; fi
321+
exit $?
322+
;;
317323
-bridge|-BRIDGE)
318324
bridgeArgs="$(sed 's/,/ /g' <<<$2)"
319325
shift

0 commit comments

Comments
 (0)