]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Compress: check if image exists
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 5 Jun 2019 17:36:40 +0000 (14:36 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 5 Jun 2019 17:36:40 +0000 (14:36 -0300)
kvmx

diff --git a/kvmx b/kvmx
index b146a289df3393c2661e7361b54c737aacd81a96..920e346e5fc3508f1a9a6f068ad280239bbf1885 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -1939,6 +1939,11 @@ function kvmx_compress {
     exit 1
   fi
 
+  if [ ! -e "$image" ]; then
+    echo "$BASENAME: image not found: $image"
+    exit 1
+  fi
+
   # Avoid trying to convert guest using other images such as LVM volumes
   if [ "$format" != "qcow2" ]; then
     echo "$BASENAME: please convert guest $VM image to qcow2 and update your config"