Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102199627
D43270.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D43270.diff
View Options
diff --git a/share/examples/bhyve/vmrun.sh b/share/examples/bhyve/vmrun.sh
--- a/share/examples/bhyve/vmrun.sh
+++ b/share/examples/bhyve/vmrun.sh
@@ -62,7 +62,7 @@
echo " [-L <VNC IP for UEFI framebuffer>]"
echo " [-m <memsize>]" \
"[-n <network adapter emulation type>]"
- echo " [-p <bus/slot/func>]"
+ echo " [-p <pcidev|bus/slot/func>]"
echo " [-P <port>] [-t <tapdev>] <vmname>"
echo ""
echo " -h: display this help message"
@@ -87,8 +87,8 @@
echo " -m: memory size (default: ${DEFAULT_MEMSIZE})"
echo " -n: network adapter emulation type" \
"(default: ${DEFAULT_NIC})"
- echo " -p: pass-through a host PCI device at bus/slot/func" \
- "(e.g. 10/0/0)"
+ echo " -p: pass-through a host PCI device (e.g ppt0 or" \
+ "bus/slot/func)"
echo " -P: UEFI GOP VNC port (default: ${DEFAULT_VNCPORT})"
echo " -t: tap device for virtio-net (default: $DEFAULT_TAPDEV)"
echo " -T: Enable tablet device (for UEFI GOP)"
@@ -351,10 +351,21 @@
i=0
while [ $i -lt $pass_total ] ; do
- eval "pass=\$pass_dev${i}"
- devargs="$devargs -s $nextslot:0,passthru,${pass} "
- nextslot=$(($nextslot + 1))
- i=$(($i + 1))
+ eval "pass=\$pass_dev${i}"
+ bsfform="$(echo "${pass}" | grep "^[0-9]\+/[0-9]\+/[0-9]\+$")"
+ if [ -z "${bsfform}" ]; then
+ bsf="$(pciconf -l "${pass}" 2>/dev/null)"
+ if [ $? -ne 0 ]; then
+ errmsg "${pass} is not a host PCI device"
+ exit 1
+ fi
+ bsf="$(echo "${bsf}" | awk -F: '{print $2"/"$3"/"$4}')"
+ else
+ bsf="${pass}"
+ fi
+ devargs="$devargs -s $nextslot:0,passthru,${bsf} "
+ nextslot=$(($nextslot + 1))
+ i=$(($i + 1))
done
efiargs=""
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 8:58 PM (18 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14565693
Default Alt Text
D43270.diff (1 KB)
Attached To
Mode
D43270: vmrun.sh: allow device name arguments in pci-passthru option
Attached
Detach File
Event Timeline
Log In to Comment