aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-10-24 16:30:15 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-10-24 16:30:15 -0300
commit1d9ccc542d0b6d6dd8db085cfb5269a603d90b94 (patch)
tree3ea037bdfdf45839738ebd96bf4aad49e0190410
parentbc450a5189e4e380a626dd8b1ebdee2497a2d7df (diff)
downloadkvmx-1d9ccc542d0b6d6dd8db085cfb5269a603d90b94.tar.gz
kvmx-1d9ccc542d0b6d6dd8db085cfb5269a603d90b94.tar.bz2
Change backing_file behavior
-rwxr-xr-xkvmx16
-rwxr-xr-xkvmx-status2
-rw-r--r--kvmxfile4
3 files changed, 9 insertions, 13 deletions
diff --git a/kvmx b/kvmx
index a1d2012..102391d 100755
--- a/kvmx
+++ b/kvmx
@@ -365,15 +365,10 @@ function kvmx_up {
exit 1
fi
- if [ ! -z "$backing_file" ]; then
- if [ -e "$backing_file" ]; then
- echo "Creating image $image as an overlay of $backing_file..."
- backing_file_format="`qemu-img info $backing_file | grep "^file format: " | cut -d : -f 2 | sed -e 's/ //g'` "
- qemu-img create -o backing_file=$backing_file,backing_fmt=$backing_file_format -f $format $image
- else
- echo "Backing file not found: $backing_file"
- exit 1
- fi
+ if [ ! -z "$backing_file" ] && [ "$backing_file" == "1" ]; then
+ echo "Creating image $image as an overlay of $baseimage..."
+ baseimage_format="`qemu-img info $baseimage | grep "^file format: " | cut -d : -f 2 | sed -e 's/ //g'` "
+ qemu-img create -o backing_file=$baseimage,backing_fmt=$baseimage_format -f $format $image
else
echo "Copying base image $baseimage to $image..."
if which rsync &> /dev/null; then
@@ -446,7 +441,8 @@ function kvmx_up {
fi
if [ -z "$net" ] || [ "$net" == "user" ]; then
- net_opts="user,hostfwd=tcp:127.0.0.1:$SSH-:22,hostfwd=udp:127.0.0.1:$XDMCP_PORT-:177$hostfwd -net nic,model=$nic_model"
+ #net_opts="user,hostfwd=tcp:127.0.0.1:$SSH-:22,hostfwd=udp:127.0.0.1:$XDMCP_PORT-:177$hostfwd -net nic,model=$nic_model"
+ net_opts="user,hostfwd=tcp:127.0.0.1:$SSH-:22$hostfwd -net nic,model=$nic_model"
elif [ "$net" == "tap" ]; then
# Thanks kvm-manager
tap="${VM}0"
diff --git a/kvmx-status b/kvmx-status
index 6a90997..1d5868b 100755
--- a/kvmx-status
+++ b/kvmx-status
@@ -28,7 +28,7 @@ $DIRNAME/kvmx-supervise status
## Get instances
#instances="`kvmx list`"
#
-## Kill old instances
+## Check instance status
#for vm in $instances; do
# kvmx status $vm
#done
diff --git a/kvmxfile b/kvmxfile
index 5f09daf..77250be 100644
--- a/kvmxfile
+++ b/kvmxfile
@@ -119,9 +119,9 @@ xrandr="0"
# Where the guest image is stored
#image="$HOME/.local/share/kvmx/$VM/box.img"
-# Backing file for overlay images
+# Use basebox image as a backing file for overlay images
# See https://wiki.archlinux.org/index.php/QEMU#Overlay_storage_images
-#backing_file="$HOME/.local/share/kvmx/$basebox/box.img"
+#backing_file="1"
# Where datafiles are stored: just set this if you know what you're doing
#datadir="$HOME/.local/share/kvmx/$VM"