[PATCH v2] testbot: Fix the "no snapshot" case in BackupVM.

Francois Gouget fgouget at codeweavers.com
Mon Aug 26 18:53:23 CDT 2019


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---

While the previous version allowed me to do a backup of my VM which did 
not yet have snapshots, Alexandre rightfully pointed out it stopped 
backing up snapshots at all. Ouch. Now I need to backup VMs with 
snapshots again so here's a proper fix.


 testbot/scripts/BackupVM | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/testbot/scripts/BackupVM b/testbot/scripts/BackupVM
index 2cf3320d..d7e54839 100755
--- a/testbot/scripts/BackupVM
+++ b/testbot/scripts/BackupVM
@@ -209,10 +209,14 @@ then
 fi
 
 snapshots=`echo "/$snapdir/$opt_vm"/*.xml`
-if [ -n "$opt_snapshot" -a "$snapshots" = "/$snapdir/$opt_vm/*.xml" ]
+if [ "$snapshots" = "/$snapdir/$opt_vm/*.xml" ]
 then
-    error "the '$opt_vm' VM does not seem to have snapshots! Use --no-snapshot if this is expected."
-    exit 2
+    if [ -n "$opt_snapshot" ]
+    then
+        error "the '$opt_vm' VM does not seem to have snapshots! Use --no-snapshot if this is expected."
+        exit 2
+    fi
+    snapshots=""
 fi
 
 # Backup the symbolic links but also their targets!
-- 
2.20.1



More information about the wine-devel mailing list