Grab the next available /dev/nbdX.
Change-Id: I6a2c8e58cdab889d747e870d0009f51bba0ff148
This commit is contained in:
parent
66b563e466
commit
b20e133714
@ -98,15 +98,10 @@ eval_run_d block-device-size "DIB_IMAGE_SIZE="
|
|||||||
|
|
||||||
qemu-img create -f qcow2 -o preallocation=metadata $TMP_IMAGE_PATH ${DIB_IMAGE_SIZE}G
|
qemu-img create -f qcow2 -o preallocation=metadata $TMP_IMAGE_PATH ${DIB_IMAGE_SIZE}G
|
||||||
|
|
||||||
# Should have a grab-next-dev helper ?
|
# grab the next available /dev/nbdX and connect to it
|
||||||
NBD_DEV=/dev/nbd0
|
map_nbd $TMP_IMAGE_PATH
|
||||||
if [[ $(qemu-nbd --help | grep cache) == *writeback* ]] ; then
|
echo "NBD Device: $NBD_DEV"
|
||||||
CACHE="--cache=writeback"
|
|
||||||
else
|
|
||||||
echo "Warning: qemu-nbd without --cache=writeback is /slow/."
|
|
||||||
CACHE=""
|
|
||||||
fi
|
|
||||||
sudo qemu-nbd -c $NBD_DEV $CACHE $TMP_IMAGE_PATH
|
|
||||||
export EXTRA_UNMOUNT="sudo qemu-nbd -d $NBD_DEV"
|
export EXTRA_UNMOUNT="sudo qemu-nbd -d $NBD_DEV"
|
||||||
export IMAGE_BLOCK_DEVICE=$NBD_DEV
|
export IMAGE_BLOCK_DEVICE=$NBD_DEV
|
||||||
eval_run_d block-device "IMAGE_BLOCK_DEVICE="
|
eval_run_d block-device "IMAGE_BLOCK_DEVICE="
|
||||||
|
Loading…
Reference in New Issue
Block a user