1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

bhyve/vmrun.sh: pass all existing readable disks to bhyveload(8)

This is done if the installation mode is not requested or auto-detected.
This is useful when a kernel has to be loaded from multiple disks.
For example from a RAID-Z pool or a ZFS pool with multiple top level
vdevs.

Differential Revision:	https://reviews.freebsd.org/D2723
Reviewed by:	neel
MFC after:	8 days
This commit is contained in:
Andriy Gapon 2015-06-05 15:16:26 +00:00
parent 2aa681ed31
commit 2764d3bcdb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=284024

View File

@ -186,16 +186,16 @@ make_and_check_diskdev()
echo "Launching virtual machine \"$vmname\" ..."
virtio_diskdev="$disk_dev0"
first_diskdev="$disk_dev0"
${BHYVECTL} --vm=${vmname} --destroy > /dev/null 2>&1
while [ 1 ]; do
file -s ${virtio_diskdev} | grep "boot sector" > /dev/null
file -s ${first_diskdev} | grep "boot sector" > /dev/null
rc=$?
if [ $rc -ne 0 ]; then
file -s ${virtio_diskdev} | grep ": Unix Fast File sys" > /dev/null
file -s ${first_diskdev} | grep ": Unix Fast File sys" > /dev/null
rc=$?
fi
if [ $rc -ne 0 ]; then
@ -210,14 +210,22 @@ while [ 1 ]; do
echo "is not readable"
exit 1
fi
BOOTDISK=${isofile}
installer_opt="-s 31:0,ahci-cd,${BOOTDISK}"
BOOTDISKS="-d ${isofile}"
installer_opt="-s 31:0,ahci-cd,${isofile}"
else
BOOTDISK=${virtio_diskdev}
BOOTDISKS=""
i=0
while [ $i -lt $disk_total ] ; do
eval "disk=\$disk_dev${i}"
if [ -r ${disk} ] ; then
BOOTDISKS="$BOOTDISKS -d ${disk} "
fi
i=$(($i + 1))
done
installer_opt=""
fi
${LOADER} -c ${console} -m ${memsize} -d ${BOOTDISK} ${loader_opt} \
${LOADER} -c ${console} -m ${memsize} ${BOOTDISKS} ${loader_opt} \
${vmname}
bhyve_exit=$?
if [ $bhyve_exit -ne 0 ]; then