render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From ee6247cad53bf0af3a681de82931a5da67868881 Mon Sep 17 00:00:00 2001
Message-Id: <ee6247cad53bf0af3a681de82931a5da67868881@dist-git>
From: Luyao Huang <lhuang@redhat.com>
Date: Fri, 21 Aug 2015 10:50:55 -0700
Subject: [PATCH] qemu: fix cannot set graphic passwd via
 qemuDomainSaveImageDefineXML

https://bugzilla.redhat.com/show_bug.cgi?id=1183890 [7.2.0]
https://bugzilla.redhat.com/show_bug.cgi?id=1254164 [7.2.0]
https://bugzilla.redhat.com/show_bug.cgi?id=1255859 [7.1.z]

When we try to update a xml to a image file, we will clear the
graphics passwd settings, because we do not pass VIR_DOMAIN_XML_SECURE
to qemuDomainDefCopy, qemuDomainDefFormatBuf won't format the passwd.

Add VIR_DOMAIN_XML_SECURE flag when we call qemuDomainDefCopy
in qemuDomainSaveImageUpdateDef.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
(cherry picked from commit f76df311e8896957b92d0e0c5251ee3e6754d9ac)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5f7fedc..425cf90 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5856,7 +5856,8 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver,
 
     if (!(newdef_migr = qemuDomainDefCopy(driver,
                                           newdef,
-                                          VIR_DOMAIN_XML_MIGRATABLE)))
+                                          VIR_DOMAIN_XML_MIGRATABLE |
+                                          VIR_DOMAIN_XML_SECURE)))
         goto cleanup;
 
     if (!virDomainDefCheckABIStability(def, newdef_migr)) {
-- 
2.5.0