<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 1 Mar 2017, at 22:36, Jonathon Jongsma <<a href="mailto:jjongsma@redhat.com" class="">jjongsma@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Fri, 2017-02-24 at 15:57 +0100, Pavel Grunt wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Theoretically a VM name can be a valid VM id or uuid. In that case<br class="">connecting to the VMs may be problematic since virt-viewer selects<br class="">the VM by its id then by uuid if not found then by its name.<br class=""><br class="">Introduce new command line options to cover this situation:<br class=""> "--domain-name" to connect to the VM by its name<br class=""> "--id" to connect to the VM by its id<br class=""> "--uuid" to connect to the VM by its uuid<br class="">The options are mutually exclusive<br class=""><br class="">Resolves: rhbz#1399077<br class="">---<br class=""> man/virt-viewer.pod | 14 ++++++++<br class=""> src/virt-viewer.c   | 97<br class="">+++++++++++++++++++++++++++++++++++++++++++++++------<br class=""> 2 files changed, 101 insertions(+), 10 deletions(-)<br class=""><br class="">diff --git a/man/virt-viewer.pod b/man/virt-viewer.pod<br class="">index 9abf03c..30af8db 100644<br class="">--- a/man/virt-viewer.pod<br class="">+++ b/man/virt-viewer.pod<br class="">@@ -122,6 +122,20 @@ kiosk-quit option to "on-disconnect" value,<br class="">virt-viewer will quit<br class=""> instead. Please note that --reconnect takes precedence over this<br class=""> option, and will attempt to do a reconnection before it quits.<br class=""> <br class="">+=item --id, --uuid, --domain-name<br class="">+<br class="">+Connect to the virtual machine by its id, uuid or name. These<br class="">options<br class="">+are mutual exclusive. For example the following command may<br class="">sometimes<br class="">+connect to a virtual machine with the id 2 or with the name 2<br class="">(depending<br class="">+on the number of running machines):<br class="">+<br class="">+    virt-viewer 2<br class="">+<br class="">+To always connect to the virtual machine with the name "2" use the<br class="">+"--domain-name" option:<br class="">+<br class="">+    virt-viewer --domain-name 2<br class="">+<br class=""> =back<br class=""> <br class=""> =head1 CONFIGURATION<br class="">diff --git a/src/virt-viewer.c b/src/virt-viewer.c<br class="">index 1f99552..6bc9b6d 100644<br class="">--- a/src/virt-viewer.c<br class="">+++ b/src/virt-viewer.c<br class="">@@ -82,6 +82,46 @@ static gboolean opt_attach = FALSE;<br class=""> static gboolean opt_waitvm = FALSE;<br class=""> static gboolean opt_reconnect = FALSE;<br class=""> <br class="">+typedef enum {<br class="">+    DOMAIN_SELECTION_NONE,<br class="">+    DOMAIN_SELECTION_NAME,<br class="">+    DOMAIN_SELECTION_ID,<br class="">+    DOMAIN_SELECTION_UUID,<br class="">+} DomainSelection;<br class="">+<br class="">+static const gchar* domain_selection_to_opt[] = {<br class="">+    [DOMAIN_SELECTION_NONE] = NULL,<br class="">+    [DOMAIN_SELECTION_NAME] = "--domain-name",<br class="">+    [DOMAIN_SELECTION_ID] = "--id",<br class="">+    [DOMAIN_SELECTION_UUID] = "--uuid",<br class="">+};<br class="">+<br class="">+static DomainSelection domain_selection_type =<br class="">DOMAIN_SELECTION_NONE;<br class="">+<br class="">+static gboolean<br class="">+opt_domain_selection_cb(const gchar *option_name,<br class="">+                        const gchar *value G_GNUC_UNUSED,<br class="">+                        gpointer data G_GNUC_UNUSED,<br class="">+                        GError **error)<br class="">+{<br class="">+    guint i;<br class="">+    if (domain_selection_type != DOMAIN_SELECTION_NONE) {<br class="">+        g_set_error(error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED,<br class="">+                    "selection type has been already set");<br class="">+        return FALSE;<br class="">+    }<br class="">+<br class="">+    for (i = DOMAIN_SELECTION_NAME; i <=<br class="">G_N_ELEMENTS(domain_selection_to_opt); i++) {<br class="">+        if (g_strcmp0(option_name, domain_selection_to_opt[i]) == 0)<br class="">{<br class="">+            domain_selection_type = i;<br class="">+            return TRUE;<br class="">+        }<br class="">+    }<br class="">+<br class="">+    g_assert_not_reached();<br class="">+    return FALSE;<br class="">+}<br class="">+<br class=""> static void<br class=""> virt_viewer_add_option_entries(VirtViewerApp *self, GOptionContext<br class="">*context, GOptionGroup *group)<br class=""> {<br class="">@@ -96,6 +136,12 @@ virt_viewer_add_option_entries(VirtViewerApp<br class="">*self, GOptionContext *context, GOp<br class="">           N_("Wait for domain to start"), NULL },<br class="">         { "reconnect", 'r', 0, G_OPTION_ARG_NONE, &opt_reconnect,<br class="">           N_("Reconnect to domain upon restart"), NULL },<br class="">+        { "domain-name", '\0', G_OPTION_FLAG_NO_ARG,<br class="">G_OPTION_ARG_CALLBACK, opt_domain_selection_cb,<br class="">+          N_("Select the virtual machine only by its name"), NULL },<br class="">+        { "id", '\0', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,<br class="">opt_domain_selection_cb,<br class="">+          N_("Select the virtual machine only by its id"), NULL },<br class="">+        { "uuid", '\0', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,<br class="">opt_domain_selection_cb,<br class="">+          N_("Select the virtual machine only by its uuid"), NULL },<br class="">         { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY,<br class="">&opt_args,<br class="">           NULL, "-- DOMAIN-NAME|ID|UUID" },<br class="">         { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }<br class="">@@ -114,6 +160,7 @@ virt_viewer_local_command_line<br class="">(GApplication   *gapp,<br class="">     gboolean ret = FALSE;<br class="">     VirtViewer *self = VIRT_VIEWER(gapp);<br class="">     VirtViewerApp *app = VIRT_VIEWER_APP(gapp);<br class="">+    const gchar *missing_domkey_fmt = _("\nNo DOMAIN-NAME|ID|UUID<br class="">was specified for '%s'\n\n");<br class=""> <br class="">     ret = G_APPLICATION_CLASS(virt_viewer_parent_class)-<br class=""><blockquote type="cite" class="">local_command_line(gapp, args, status);<br class=""></blockquote>     if (ret)<br class="">@@ -133,7 +180,7 @@ virt_viewer_local_command_line<br class="">(GApplication   *gapp,<br class=""> <br class="">     if (opt_waitvm) {<br class="">         if (!self->priv->domkey) {<br class="">-            g_printerr(_("\nNo DOMAIN-NAME|ID|UUID was specified for<br class="">'--wait'\n\n"));<br class="">+            g_printerr(missing_domkey_fmt, "--wait");<br class="">             ret = TRUE;<br class="">             *status = 1;<br class="">             goto end;<br class="">@@ -142,6 +189,15 @@ virt_viewer_local_command_line<br class="">(GApplication   *gapp,<br class="">         self->priv->waitvm = TRUE;<br class="">     }<br class=""> <br class="">+    if (domain_selection_type != DOMAIN_SELECTION_NONE) {<br class="">+        if (!self->priv->domkey) {<br class="">+            g_printerr(missing_domkey_fmt,<br class="">domain_selection_to_opt[domain_selection_type]);<br class="">+            ret = TRUE;<br class="">+            *status = 1;<br class="">+            goto end;<br class="">+        }<br class="">+    }<br class="">+<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">This feels a bit like excessive duplication. Could we maybe combine it</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">with the previous block? Something like (just brainstorming):</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">   if (opt_waitvm || domain_selection_type != DOMAIN_SELECTION_NONE) {</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">     if (!domkey) {</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">       // report error</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">       goto end;</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">     }</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">   }</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">   self->priv->waitvm = opt_waitvm;</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">     virt_viewer_app_set_direct(app, opt_direct);<br class="">     virt_viewer_app_set_attach(app, opt_attach);<br class="">     self->priv->reconnect = opt_reconnect;<br class="">@@ -311,16 +367,31 @@ virt_viewer_lookup_domain(VirtViewer *self)<br class="">         return NULL;<br class="">     }<br class=""> <br class="">-    id = strtol(priv->domkey, &end, 10);<br class="">-    if (id >= 0 && end && !*end) {<br class="">-        dom = virDomainLookupByID(priv->conn, id);<br class="">-    }<br class="">-    if (!dom && virt_viewer_parse_uuid(priv->domkey, uuid) == 0) {<br class="">-        dom = virDomainLookupByUUID(priv->conn, uuid);<br class="">-    }<br class="">-    if (!dom) {<br class="">-        dom = virDomainLookupByName(priv->conn, priv->domkey);<br class="">+    switch (domain_selection_type) {<br class="">+    default: /* DOMAIN_SELECTION_NONE */<br class="">+    case DOMAIN_SELECTION_ID:<br class="">+        id = strtol(priv->domkey, &end, 10);<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">'id' variable is now technically local to this scope</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">+        if (id >= 0 && end && !*end) {<br class="">+            dom = virDomainLookupByID(priv->conn, id);<br class="">+        }<br class="">+        if (domain_selection_type != DOMAIN_SELECTION_NONE) {<br class="">+            break;<br class="">+        }<br class="">+        /* fallthrough */<br class="">+    case DOMAIN_SELECTION_UUID:<br class="">+        if (!dom && virt_viewer_parse_uuid(priv->domkey, uuid) == 0)<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Same with uuid.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">{<br class="">+            dom = virDomainLookupByUUID(priv->conn, uuid);<br class="">+        }<br class="">+        if (domain_selection_type != DOMAIN_SELECTION_NONE) {<br class="">+            break;<br class="">+        }<br class="">+        /* fallthrough */<br class="">+    case DOMAIN_SELECTION_NAME:<br class="">+        if (!dom) {<br class="">+            dom = virDomainLookupByName(priv->conn, priv->domkey);<br class="">+        }<br class="">     }<br class="">+<br class="">     return dom;<br class=""> }<br class=""> <br class="">@@ -816,6 +887,12 @@ virt_viewer_initial_connect(VirtViewerApp *app,<br class="">GError **error)<br class="">         if (priv->waitvm) {<br class="">             virt_viewer_app_show_status(app, _("Waiting for guest<br class="">domain to be created"));<br class="">             goto wait;<br class="">+        } else if (domain_selection_type != DOMAIN_SELECTION_NONE) {<br class="">+            g_set_error(&err, VIRT_VIEWER_ERROR,<br class="">VIRT_VIEWER_ERROR_FAILED,<br class="">+                        _("Couldn't find domain '%s' specified by<br class="">'%s'"),<br class="">+                        priv->domkey,<br class="">+                        domain_selection_to_opt[domain_selection_typ<br class="">e]);<br class="">+            goto cleanup;<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I'm not sure that this section is necessary. After this change, the</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">following commands would behave differently, which I think is a bit</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">unexpected:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">$ virt-viewer nonexistent  # opens dialog to choose a vm</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">$ virt-viewer --domain-name nonexistent  # exits with error</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>Actually, this may be a nice feature for scripting. If you do things manually, you’ll probably use option 1. If you script something, you may use option 2, and then you probably prefer to get an exit code than a dialog box.</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">         } else {<br class="">             VirtViewerWindow *main_window =<br class="">virt_viewer_app_get_main_window(app);<br class="">             if (priv->domkey != NULL)<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Jonathon</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">virt-tools-list mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:virt-tools-list@redhat.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">virt-tools-list@redhat.com</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://www.redhat.com/mailman/listinfo/virt-tools-list" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://www.redhat.com/mailman/listinfo/virt-tools-list</a></div></blockquote></div><br class=""></body></html>