mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
virsh: fixed domdisplay command
The 'domdisplay' command didn't properly evaluate '--include-password' option.
This commit is contained in:
parent
95738b3f0d
commit
8101d43433
@ -13870,6 +13870,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
|
|||||||
const char *scheme[] = { "vnc", "spice", "rdp", NULL };
|
const char *scheme[] = { "vnc", "spice", "rdp", NULL };
|
||||||
int iter = 0;
|
int iter = 0;
|
||||||
int tmp;
|
int tmp;
|
||||||
|
int flags = 0;
|
||||||
|
|
||||||
if (!vshConnectionUsability(ctl, ctl->conn))
|
if (!vshConnectionUsability(ctl, ctl->conn))
|
||||||
return false;
|
return false;
|
||||||
@ -13882,7 +13883,11 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
doc = virDomainGetXMLDesc(dom, 0);
|
if (vshCommandOptBool(cmd, "include-password"))
|
||||||
|
flags |= VIR_DOMAIN_XML_SECURE;
|
||||||
|
|
||||||
|
doc = virDomainGetXMLDesc(dom, flags);
|
||||||
|
|
||||||
if (!doc)
|
if (!doc)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -13944,7 +13949,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
|
|||||||
if (tmp)
|
if (tmp)
|
||||||
tls_port = 0;
|
tls_port = 0;
|
||||||
|
|
||||||
if (vshCommandOptBool(cmd, "daemon")) {
|
if (vshCommandOptBool(cmd, "include-password")) {
|
||||||
/* Create our XPATH lookup for the SPICE password */
|
/* Create our XPATH lookup for the SPICE password */
|
||||||
virAsprintf(&xpath, "string(/domain/devices/graphics"
|
virAsprintf(&xpath, "string(/domain/devices/graphics"
|
||||||
"[@type='%s']/@passwd)", scheme[iter]);
|
"[@type='%s']/@passwd)", scheme[iter]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user