[libvirt] [PATCH 2/4] libvirt-guests: Don't try to do a managed-save of transient guests
Eric Blake
eblake at redhat.com
Wed Feb 29 02:59:11 UTC 2012
On 02/28/2012 11:00 AM, Peter Krempa wrote:
> The libvirt-guests script tried to do a managed save of transient guest
> that failed. This patch notifies which guests are transient (and not
> being saved) and saves only the persistent ones.
> ---
> tools/libvirt-guests.init.sh | 37 +++++++++++++++++++++++++++++++++++--
> 1 files changed, 35 insertions(+), 2 deletions(-)
ACK with one fix:
> + # reload domain list to contain only persistent guests
> + list=$(list_guests "$uri" "--persistent")
> + if [ $? -ne 0 ]; then
> + eval_gettext "Failed to list persistent guests on \$uri"
> + echo
> + RETVAL=1
> + return
> + fi
> else
> + gettext "Failed to list transient guests"
> echo
> - echo "$uri" "$list" >>"$LISTFILE"
> + RETVAL=1
> + return
Before these two return statements, you need to add a 'set +f' statement;
> fi
> fi
> +
> + if [ -n "$list" ]; then
> + echo "$uri" "$list" >>"$LISTFILE"
> + fi
> done
> set +f
since both of those early exits need to leave the function in the same
state as if you exited normally.
--
Eric Blake eblake at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120228/3b0b412d/attachment-0001.sig>
More information about the libvir-list
mailing list