@ -143,6 +143,11 @@ function vm_boot() {
fi
fi
fi
fi
# Has the status quo been requested?
if [ "${STATUSQUO}" == "-snapshot" ] && [ -z "${iso}" ]; then
echo " Existing disk state will be preserved, no writes will be committed."
fi
local cores="1"
local cores="1"
local allcores=$(nproc --all)
local allcores=$(nproc --all)
if [ ${allcores} -ge 8 ]; then
if [ ${allcores} -ge 8 ]; then
@ -228,7 +233,7 @@ function vm_boot() {
-object rng-random,id=rng0,filename=/dev/urandom \
-object rng-random,id=rng0,filename=/dev/urandom \
-device virtio-rng-pci,rng=rng0 \
-device virtio-rng-pci,rng=rng0 \
-device virtio-vga,virgl=${VIRGL},xres=${xres},yres=${yres} \
-device virtio-vga,virgl=${VIRGL},xres=${xres},yres=${yres} \
${display} \
${display} ${STATUSQUO} \
"$@"
"$@"
}
}
@ -244,6 +249,7 @@ function usage() {
echo " --snapshot create <tag> : Create a snapshot."
echo " --snapshot create <tag> : Create a snapshot."
echo " --snapshot delete <tag> : Delete a snapshot."
echo " --snapshot delete <tag> : Delete a snapshot."
echo " --snapshot info : Show disk/snapshot info."
echo " --snapshot info : Show disk/snapshot info."
echo " --status-quo : Do not commit any changes to disk/snapshot."
exit 1
exit 1
}
}
@ -254,6 +260,7 @@ readonly QEMU_IMG="/snap/bin/qemu-virgil.qemu-img"
readonly LAUNCHER=$(basename $0)
readonly LAUNCHER=$(basename $0)
SNAPSHOT_ACTION=""
SNAPSHOT_ACTION=""
SNAPSHOT_TAG=""
SNAPSHOT_TAG=""
STATUSQUO=""
VM=""
VM=""
while [ $# -gt 0 ]; do
while [ $# -gt 0 ]; do
@ -278,6 +285,9 @@ while [ $# -gt 0 ]; do
fi
fi
shift
shift
shift;;
shift;;
-status-quo|--status-quo)
STATUSQUO="-snapshot"
shift;;
-vm|--vm)
-vm|--vm)
VM="$2"
VM="$2"
shift
shift