[libvirt] [PATCH] virsh: Allow starting domains by UUID

Eric Blake eblake at redhat.com
Fri Mar 11 17:48:07 UTC 2011


On 03/11/2011 04:15 AM, Jiri Denemark wrote:
> ---
>  tools/libvirt-guests.init.sh |    2 +-
>  tools/virsh.c                |    3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/libvirt-guests.init.sh b/tools/libvirt-guests.init.sh
> index 8823d06..e37e55f 100644
> --- a/tools/libvirt-guests.init.sh
> +++ b/tools/libvirt-guests.init.sh
> @@ -164,7 +164,7 @@ start() {
>                  if $guest_running; then
>                      gettext "already active"; echo
>                  else
> -                    retval run_virsh $uri start "$name" >/dev/null && \
> +                    retval run_virsh $uri start "$guest" >/dev/null && \
>                      gettext "done"; echo
>                  fi
>              fi
> diff --git a/tools/virsh.c b/tools/virsh.c
> index a5e9c4f..b42aac4 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -1402,7 +1402,8 @@ cmdStart(vshControl *ctl, const vshCmd *cmd)
>      if (!vshConnectionUsability(ctl, ctl->conn))
>          return FALSE;
>  
> -    if (!(dom = vshCommandOptDomainBy(ctl, cmd, NULL, VSH_BYNAME)))
> +    if (!(dom = vshCommandOptDomainBy(ctl, cmd, NULL,
> +                                      VSH_BYNAME | VSH_BYUUID)))

ACK.  How many more of these might we be missing, due to copy-and-paste?

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110311/851617bb/attachment-0001.sig>


More information about the libvir-list mailing list