libvirt-guests: Remove LISTFILE if it's empty when stopping service

$LISTFILE is created even no domain is running, and the empty
$LISTFILE could cause improper service status.

    stopped ,with saved guests

Which is not right, as there is no domain was saved.
This commit is contained in:
Osier Yang 2012-05-15 16:22:28 +08:00
parent 10d9038b74
commit c086af6b9b

View File

@ -461,6 +461,7 @@ stop() {
done
set +f
if [ -s "$LISTFILE" ]; then
while read uri list; do
if "$suspending"; then
eval_gettext "Suspending guests on \$uri URI..."; echo
@ -481,6 +482,9 @@ stop() {
done
fi
done <"$LISTFILE"
else
rm -f "$LISTFILE"
fi
rm -f "$VAR_SUBSYS_LIBVIRT_GUESTS"
}