qemu: Clear old translated pool source

Clear the old data to avoid leaking it when attempting to re-translate a
pool on the same domain object.
This commit is contained in:
Peter Krempa 2013-11-25 16:12:54 +01:00
parent 0df53f0432
commit bdeb0f0123

View File

@ -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: