[libvirt] [PATCH 22/22] qemu: Clear old translated pool source

Peter Krempa pkrempa at redhat.com
Mon Nov 25 16:12:06 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 e098c13..1192d23 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