aboutsummaryrefslogtreecommitdiff
path: root/kvmx
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-01-02 22:04:07 -0200
committerSilvio Rhatto <rhatto@riseup.net>2018-01-02 22:04:07 -0200
commit7441b792e197734b85f7c01a64397fb97a267128 (patch)
tree9e75019a3ed39e556a42d817c12605d29d2138f6 /kvmx
parent6207b570cf9bc67fb0988ce91f5c79e6430c0acc (diff)
downloadkvmx-7441b792e197734b85f7c01a64397fb97a267128.tar.gz
kvmx-7441b792e197734b85f7c01a64397fb97a267128.tar.bz2
Adds qcow2_compression config, use https://deb.debian.org/debian/ mirror when possible
Diffstat (limited to 'kvmx')
-rwxr-xr-xkvmx11
1 files changed, 10 insertions, 1 deletions
diff --git a/kvmx b/kvmx
index 80fbcff..e4fedb8 100755
--- a/kvmx
+++ b/kvmx
@@ -1312,6 +1312,11 @@ function kvmx_restart {
echo "Guest $VM was not running, so starting it anyway..."
kvmx_start
else
+ #if [ "$ssh_support" != "y" ]; then
+ # echo sudo reboot | kvmx_ssh
+ # exit
+ #fi
+
echo "Powering off guest $VM..."
kvmx_poweroff
@@ -1616,11 +1621,15 @@ function kvmx_compress {
exit 1
fi
+ if [ "$qcow2_compression" != "0" ]; then
+ $compression = "-c"
+ fi
+
# Size before compression
local size_before_bytes="`du $image | awk '{ print $1 }'`"
local size_before_human="`du -h $image | awk '{ print $1 }'`"
- qemu-img convert -O qcow2 -p -c $image $image.new && mv $image.new $image || exit 1
+ qemu-img convert -O qcow2 -p $compression $image $image.new && mv $image.new $image || exit 1
# Size after compression
local size_after_bytes="`du $image | awk '{ print $1 }'`"