aboutsummaryrefslogtreecommitdiff
path: root/kvmx
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-06-19 18:43:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-06-19 18:43:42 -0300
commit6975e5d989db764bba0891b875abc41d9761884b (patch)
tree295317d53f43ca099af7d6158db4a420665cd9d0 /kvmx
parentd81d656fb99617cf9f48b174b3066766d928a870 (diff)
downloadkvmx-6975e5d989db764bba0891b875abc41d9761884b.tar.gz
kvmx-6975e5d989db764bba0891b875abc41d9761884b.tar.bz2
Adds support fo run live systems
Diffstat (limited to 'kvmx')
-rwxr-xr-xkvmx14
1 files changed, 11 insertions, 3 deletions
diff --git a/kvmx b/kvmx
index 2ea0a30..ae1a7cd 100755
--- a/kvmx
+++ b/kvmx
@@ -443,27 +443,35 @@ function kvmx_up {
sound_opts="-soundhw $sound"
fi
+ if [ ! -z "$image_drive" ] && [ "$image_drive" == "cdrom" ]; then
+ image_opts="-cdrom $image"
+ else
+ image_opts="-drive file=$image,if=$drive_interface"
+ fi
+
# Run virtual machine, nohup approach
# See https://en.wikipedia.org/wiki/Nohup#Overcoming_hanging
#nohup kvm -m $memory -name $VM \
- # -drive file=$image,if=$drive_interface $graphics $shared \
# -chardev "socket,id=monitor,path=$MONITORFILE,server,nowait" -mon chardev=monitor,mode=readline \
# -chardev "socket,id=serial0,path=$CONSOLEFILE,server,nowait" -device isa-serial,chardev=serial0 \
# -smp $smp -cpu host -balloon virtio \
+ # $graphics $shared \
+ # $image_opts \
+ # $spice_opts \
# $sound_opts \
# $cdrom_opts \
# $boot_opts \
- # $spice_opts \
# $net_opts \
# $qemu_opts &> $LOGFILE < /dev/null &
# Run virtual machine, screen approach
# This is more immune to hangups
screen -S kvmx-qemu-$VM -d -m kvm -m $memory -name $VM \
- -drive file=$image,if=$drive_interface $graphics $shared \
-chardev "socket,id=monitor,path=$MONITORFILE,server,nowait" -mon chardev=monitor,mode=readline \
-chardev "socket,id=serial0,path=$CONSOLEFILE,server,nowait" -device isa-serial,chardev=serial0 \
-smp $smp -cpu host -balloon virtio \
+ $graphics $shared \
+ $image_opts \
$spice_opts \
$sound_opts \
$cdrom_opts \