c401cc
From e9fd55b157ea991a4439db5a49e97ced55b67e9f Mon Sep 17 00:00:00 2001
c401cc
Message-Id: <e9fd55b157ea991a4439db5a49e97ced55b67e9f@dist-git>
c401cc
From: Peter Krempa <pkrempa@redhat.com>
c401cc
Date: Wed, 26 Feb 2014 14:55:02 +0100
c401cc
Subject: [PATCH] qemu: Clear old translated pool source
c401cc
c401cc
https://bugzilla.redhat.com/show_bug.cgi?id=1032370
c401cc
c401cc
Clear the old data to avoid leaking it when attempting to re-translate a
c401cc
pool on the same domain object.
c401cc
c401cc
(cherry picked from commit bdeb0f01239ad6b8acf1f24ce9f199c2d0682c06)
c401cc
c401cc
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c401cc
---
c401cc
 src/qemu/qemu_conf.c | 4 ++++
c401cc
 1 file changed, 4 insertions(+)
c401cc
c401cc
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
c401cc
index 0908547..a2a7f97 100644
c401cc
--- a/src/qemu/qemu_conf.c
c401cc
+++ b/src/qemu/qemu_conf.c
c401cc
@@ -1329,6 +1329,10 @@ qemuTranslateDiskSourcePool(virConnectPtr conn,
c401cc
         goto cleanup;
c401cc
     }
c401cc
 
c401cc
+    VIR_FREE(def->src);
c401cc
+    virDomainDiskHostDefFree(def->nhosts, def->hosts);
c401cc
+    virDomainDiskAuthClear(def);
c401cc
+
c401cc
     switch ((enum virStoragePoolType) pooldef->type) {
c401cc
     case VIR_STORAGE_POOL_DIR:
c401cc
     case VIR_STORAGE_POOL_FS:
c401cc
-- 
c401cc
1.9.0
c401cc