|
|
0d20ef |
From a1d1b87d1d574f7bfbd95681cb8e456cec18b33b Mon Sep 17 00:00:00 2001
|
|
|
0d20ef |
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
0d20ef |
Date: Mon, 15 Dec 2014 08:55:12 +0000
|
|
|
0d20ef |
Subject: [PATCH] v2v: Get passwords in domain XML (RHBZ#1174123).
|
|
|
0d20ef |
|
|
|
0d20ef |
Thanks: Tingting Zheng
|
|
|
0d20ef |
(cherry picked from commit dfded7c94118e8888dec38f11c2af62d8156a59e)
|
|
|
0d20ef |
---
|
|
|
0d20ef |
v2v/domainxml-c.c | 8 ++++++--
|
|
|
0d20ef |
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
|
0d20ef |
|
|
|
0d20ef |
diff --git a/v2v/domainxml-c.c b/v2v/domainxml-c.c
|
|
|
0d20ef |
index b57440c..c9ed8c5 100644
|
|
|
0d20ef |
--- a/v2v/domainxml-c.c
|
|
|
0d20ef |
+++ b/v2v/domainxml-c.c
|
|
|
0d20ef |
@@ -138,7 +138,10 @@ v2v_dumpxml (value passwordv, value connv, value domnamev)
|
|
|
0d20ef |
authdata.cb = libvirt_auth_default_wrapper;
|
|
|
0d20ef |
authdata.cbdata = (void *) password;
|
|
|
0d20ef |
|
|
|
0d20ef |
- conn = virConnectOpenAuth (conn_uri, &authdata, VIR_CONNECT_RO);
|
|
|
0d20ef |
+ /* Note this cannot be a read-only connection since we need to use
|
|
|
0d20ef |
+ * the VIR_DOMAIN_XML_SECURE flag below.
|
|
|
0d20ef |
+ */
|
|
|
0d20ef |
+ conn = virConnectOpenAuth (conn_uri, &authdata, 0);
|
|
|
0d20ef |
if (conn == NULL) {
|
|
|
0d20ef |
if (conn_uri)
|
|
|
0d20ef |
snprintf (errmsg, sizeof errmsg,
|
|
|
0d20ef |
@@ -188,7 +191,8 @@ v2v_dumpxml (value passwordv, value connv, value domnamev)
|
|
|
0d20ef |
}
|
|
|
0d20ef |
}
|
|
|
0d20ef |
|
|
|
0d20ef |
- xml = virDomainGetXMLDesc (dom, 0);
|
|
|
0d20ef |
+ /* Use VIR_DOMAIN_XML_SECURE to get passwords (RHBZ#1174123). */
|
|
|
0d20ef |
+ xml = virDomainGetXMLDesc (dom, VIR_DOMAIN_XML_SECURE);
|
|
|
0d20ef |
if (xml == NULL) {
|
|
|
0d20ef |
err = virGetLastError ();
|
|
|
0d20ef |
snprintf (errmsg, sizeof errmsg,
|
|
|
0d20ef |
--
|
|
|
0d20ef |
1.8.3.1
|
|
|
0d20ef |
|