mirror of
https://github.com/churchers/vm-bhyve.git
synced 2025-12-11 09:20:17 +01:00
Wait for zvol to appear
This commit is contained in:
11
lib/vm-core
11
lib/vm-core
@@ -313,9 +313,18 @@ core::write_img(){
|
|||||||
shift $?
|
shift $?
|
||||||
_disk_dev="${1}"
|
_disk_dev="${1}"
|
||||||
_img="$2"
|
_img="$2"
|
||||||
|
timeout=30
|
||||||
|
i=0
|
||||||
|
|
||||||
# wait a few seconds for newly created zvol device to appear
|
# wait a few seconds for newly created zvol device to appear
|
||||||
sleep 2
|
while [ $i -lt $timeout ]; do
|
||||||
|
if [ ! -r "${_disk_dev}" ]; then
|
||||||
|
sleep 1
|
||||||
|
i=$(($i+1))
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# just run start with an iso
|
# just run start with an iso
|
||||||
datastore::img_find "_imgpath" "${_img}" || util::err "unable to locate img file - '${_img}'"
|
datastore::img_find "_imgpath" "${_img}" || util::err "unable to locate img file - '${_img}'"
|
||||||
|
|||||||
Reference in New Issue
Block a user