render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From e9fd55b157ea991a4439db5a49e97ced55b67e9f Mon Sep 17 00:00:00 2001
Message-Id: <e9fd55b157ea991a4439db5a49e97ced55b67e9f@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 26 Feb 2014 14:55:02 +0100
Subject: [PATCH] qemu: Clear old translated pool source

https://bugzilla.redhat.com/show_bug.cgi?id=1032370

Clear the old data to avoid leaking it when attempting to re-translate a
pool on the same domain object.

(cherry picked from commit bdeb0f01239ad6b8acf1f24ce9f199c2d0682c06)

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_conf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 0908547..a2a7f97 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1329,6 +1329,10 @@ qemuTranslateDiskSourcePool(virConnectPtr conn,
         goto cleanup;
     }
 
+    VIR_FREE(def->src);
+    virDomainDiskHostDefFree(def->nhosts, def->hosts);
+    virDomainDiskAuthClear(def);
+
     switch ((enum virStoragePoolType) pooldef->type) {
     case VIR_STORAGE_POOL_DIR:
     case VIR_STORAGE_POOL_FS:
-- 
1.9.0