[virt-tools-list] [virt-viewer] Only wait for shutoff domains when --wait is used

Jonathon Jongsma jjongsma at redhat.com
Tue Aug 5 13:44:45 UTC 2014


----- Original Message -----
> From: "Christophe Fergeau" <cfergeau at redhat.com>
> To: virt-tools-list at redhat.com
> Sent: Tuesday, August 5, 2014 4:40:49 AM
> Subject: [virt-tools-list] [virt-viewer] Only wait for shutoff domains when	--wait is used
> 
> --wait is documented as:
>      -w, --wait
>          Wait for the domain to start up before attempting to connect to the
>          console
> 
> However, running 'virt-viewer non-running-domain' currently shows a
> "Waiting for guest domain to start" regardless of the --wait argument.
> This commit makes virt-viewer error out on non-running domains when
> --wait was not passed on the command line.
> ---
>  src/virt-viewer.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/src/virt-viewer.c b/src/virt-viewer.c
> index 8a1d8c5..22615cc 100644
> --- a/src/virt-viewer.c
> +++ b/src/virt-viewer.c
> @@ -570,7 +570,14 @@ virt_viewer_initial_connect(VirtViewerApp *app, GError
> **error)
>      }
>  
>      if (info.state == VIR_DOMAIN_SHUTOFF) {
> -        virt_viewer_app_show_status(app, _("Waiting for guest domain to
> start"));
> +        if (priv->waitvm)
> +            virt_viewer_app_show_status(app, _("Waiting for guest domain to
> start"));
> +        else {
> +            virt_viewer_app_simple_message_dialog(app, _("Guest domain %s is
> not running"),
> +                                                  priv->domkey);
> +            g_debug("Domain %s is not running", priv->domkey);
> +            goto cleanup;
> +        }
>      } else {
>          ret = virt_viewer_update_display(self, dom);
>          if (ret)
> --
> 1.9.3
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
> 


Hm, It seems that this was always broken. I've even gotten accustomed to this behavior. But it's obviously not supposed to wait unless --wait is specified. ACK.

Jonathon




More information about the virt-tools-list mailing list