Re: [PATCH 2/4] libvirt-guests: Don't try to do a managed-save of transient guests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]