[libvirt] [PATCHv1.5 21/27] qemu: Clear old translated pool source

Peter Krempa pkrempa at redhat.com
Tue Nov 26 16:49:03 UTC 2013


Clear the old data to avoid leaking it when attempting to re-translate a
pool on the same domain object.
---
 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 58a0500..639e2ff 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1360,6 +1360,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.8.4.3




More information about the libvir-list mailing list