summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-main.c
diff options
context:
space:
mode:
authorPavel Grunt <pgrunt@redhat.com>2015-04-14 16:22:37 +0200
committerPavel Grunt <pgrunt@redhat.com>2015-04-14 18:21:38 +0200
commitd71c2a673db4f647ff961fbd1add64216dd84c03 (patch)
treea7415632c89cd2a88f7ee70b34e36f551e247f63 /src/virt-viewer-main.c
parentea42d030272890b0fe6c198d017d754ba027007d (diff)
downloadvirt-viewer-d71c2a673db4f647ff961fbd1add64216dd84c03.tar.gz
virt-viewer-d71c2a673db4f647ff961fbd1add64216dd84c03.tar.xz
virt-viewer-d71c2a673db4f647ff961fbd1add64216dd84c03.zip
Revert "virt-viewer-main: Require domain name as argument for '--wait'"
This reverts commit a830275344c88aef12166661b68ea2b4429c7212. Commit a830275344c88aef12166661b68ea2b4429c7212 required the domain name to be placed just after the '--wait' option. It broke the command line api, because running 'virt-viewer $vm --wait' was considered as the error. Related: rhbz#1209398, rhbz#1211573
Diffstat (limited to 'src/virt-viewer-main.c')
-rw-r--r--src/virt-viewer-main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/virt-viewer-main.c b/src/virt-viewer-main.c
index 8c1ca80..af1251e 100644
--- a/src/virt-viewer-main.c
+++ b/src/virt-viewer-main.c
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
gchar **args = NULL;
gboolean direct = FALSE;
gboolean attach = FALSE;
- char *waitvm = NULL;
+ gboolean waitvm = FALSE;
gboolean reconnect = FALSE;
VirtViewer *viewer = NULL;
char *base_name;
@@ -64,8 +64,8 @@ int main(int argc, char **argv)
N_("Attach to the local display using libvirt"), NULL },
{ "connect", 'c', 0, G_OPTION_ARG_STRING, &uri,
N_("Connect to hypervisor"), "URI"},
- { "wait", 'w', 0, G_OPTION_ARG_STRING, &waitvm,
- N_("Wait for domain to start"), "DOMAIN-NAME|ID|UUID" },
+ { "wait", 'w', 0, G_OPTION_ARG_NONE, &waitvm,
+ N_("Wait for domain to start"), NULL },
{ "reconnect", 'r', 0, G_OPTION_ARG_NONE, &reconnect,
N_("Reconnect to domain upon restart"), NULL },
{ G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &args,
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
goto cleanup;
}
- viewer = virt_viewer_new(uri, (args) ? args[0] : waitvm, direct, attach, waitvm != NULL, reconnect);
+ viewer = virt_viewer_new(uri, (args) ? args[0] : NULL, direct, attach, waitvm, reconnect);
if (viewer == NULL)
goto cleanup;
@@ -129,7 +129,6 @@ int main(int argc, char **argv)
if (viewer)
g_object_unref(viewer);
g_free(uri);
- g_free(waitvm);
g_strfreev(args);
g_free(help_msg);
g_clear_error(&error);