]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: fixed domdisplay command
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 24 Jul 2012 14:00:14 +0000 (16:00 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 24 Jul 2012 14:58:20 +0000 (16:58 +0200)
The 'domdisplay' command didn't properly evaluate '--include-password'
option.

tools/virsh.c

index 6bb0fc8a99df357c5fa88ed3f53b44c836b59f92..6d650363600b9cd575472e616f87d6bc9b02d52f 100644 (file)
@@ -13870,6 +13870,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
     const char *scheme[] = { "vnc", "spice", "rdp", NULL };
     int iter = 0;
     int tmp;
+    int flags = 0;
 
     if (!vshConnectionUsability(ctl, ctl->conn))
         return false;
@@ -13882,7 +13883,11 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;
     }
 
-    doc = virDomainGetXMLDesc(dom, 0);
+    if (vshCommandOptBool(cmd, "include-password"))
+        flags |= VIR_DOMAIN_XML_SECURE;
+
+    doc = virDomainGetXMLDesc(dom, flags);
+
     if (!doc)
         goto cleanup;
 
@@ -13944,7 +13949,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
             if (tmp)
                 tls_port = 0;
 
-            if (vshCommandOptBool(cmd, "daemon")) {
+            if (vshCommandOptBool(cmd, "include-password")) {
                 /* Create our XPATH lookup for the SPICE password */
                 virAsprintf(&xpath, "string(/domain/devices/graphics"
                         "[@type='%s']/@passwd)", scheme[iter]);