diff --git a/AUTHORS b/AUTHORS index 51d6b11..bb361c2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,6 +11,7 @@ Atsushi SAKAI Richard W.M. Jones Guido G\374nther + Hiroyuki Kaguchi ...send patches to get your name here... diff --git a/src/main.c b/src/main.c index 6e78363..6cea1f3 100644 --- a/src/main.c +++ b/src/main.c @@ -803,23 +803,25 @@ } do { - dom = viewer_lookup_domain(conn, name); - if (!dom && !waitvnc) { - fprintf(stderr, "unable to lookup domain %s\n", name); - return 3; - } - if (!dom) - usleep(500*1000); - } while (!dom); - - do { + do { + dom = viewer_lookup_domain(conn, name); + if (!dom && !waitvnc) { + fprintf(stderr, "unable to lookup domain %s\n", name); + return 3; + } + if (!dom) + usleep(500*1000); + } while (!dom); + viewer_extract_vnc_graphics(dom, &vncport); if (!vncport && !waitvnc) { fprintf(stderr, "unable to find vnc graphics for %s\n", name); return 4; } - if (!vncport) + if (!vncport) { + virDomainFree(dom); usleep(300*1000); + } } while (!vncport); tmpname = virDomainGetName(dom); if (tmpname != NULL) { @@ -894,7 +896,7 @@ char *uri = NULL; char *name = NULL; int opt_ind; - const char *sopts = "hVc:"; + const char *sopts = "hVvc:wd"; static const struct option lopts[] = { { "help", 0, 0, 'h' }, { "version", 0, 0, 'V' },