diff --git a/blockcommit_all.sh b/blockcommit_all.sh index bb1b646..092fc71 100755 --- a/blockcommit_all.sh +++ b/blockcommit_all.sh @@ -24,13 +24,14 @@ do if [ ! -z "$path_vdb" ] then echo "-- BLOCKCOMMITTING $vm disk vdb ..." - retour=$(sudo virsh blockcommit $vm vdb --active --verbose --pivot --de> + retour=$(sudo virsh blockcommit $vm vdb --active --verbose --pivot --delete 2>&1 | tee /dev/tty) + if [[ "$retour" =~ 'block copy still active' ]] then echo "-- Finishing blockjob for $vm ..." sudo virsh blockjob $vm $path_vdb --pivot --info echo "-- BLOCKCOMMITTING $vm ..." - sudo virsh blockcommit $vm vdb --active --verbose --pivot --delete > + sudo virsh blockcommit $vm vda --active --verbose --pivot --delete 2>&1 fi fi done