Signed-off-by: Francois Gouget fgouget@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!