When virt-viewer is executed specifying "--wait" option, the graphical
console is not displayed even through the domain is started.
The cause of this trouble is that virt-viewer try to get the vncport number
from the information of the stopping domain.
This patch fixes "--wait" option.

Thanks,
Signed-off-by: Hiroyuki Kaguchi <[EMAIL PROTECTED]>
diff -r e2ee322e3d1a -r b37550a1a79c src/main.c
--- a/src/main.c        Tue Apr 08 15:17:24 2008 -0400
+++ b/src/main.c        Mon Apr 21 18:09:43 2008 +0900
@@ -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 {
+                       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 {
                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' },
_______________________________________________
et-mgmt-tools mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

Reply via email to