mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
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:
parent
10d9038b74
commit
c086af6b9b
@ -461,6 +461,7 @@ stop() {
|
|||||||
done
|
done
|
||||||
set +f
|
set +f
|
||||||
|
|
||||||
|
if [ -s "$LISTFILE" ]; then
|
||||||
while read uri list; do
|
while read uri list; do
|
||||||
if "$suspending"; then
|
if "$suspending"; then
|
||||||
eval_gettext "Suspending guests on \$uri URI..."; echo
|
eval_gettext "Suspending guests on \$uri URI..."; echo
|
||||||
@ -481,6 +482,9 @@ stop() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
done <"$LISTFILE"
|
done <"$LISTFILE"
|
||||||
|
else
|
||||||
|
rm -f "$LISTFILE"
|
||||||
|
fi
|
||||||
|
|
||||||
rm -f "$VAR_SUBSYS_LIBVIRT_GUESTS"
|
rm -f "$VAR_SUBSYS_LIBVIRT_GUESTS"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user