diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2018-01-02 22:04:07 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2018-01-02 22:04:07 -0200 |
commit | 7441b792e197734b85f7c01a64397fb97a267128 (patch) | |
tree | 9e75019a3ed39e556a42d817c12605d29d2138f6 /kvmx | |
parent | 6207b570cf9bc67fb0988ce91f5c79e6430c0acc (diff) | |
download | kvmx-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-x | kvmx | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 }'`" |