On 2012年03月21日 01:33, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange(a)redhat.com>
Since we defined a custom virURIPtr type, we should use a
virURIFree method instead of assuming it will always be
a typedef for xmlURIPtr
* src/util/viruri.c, src/util/viruri.h, src/libvirt_private.syms:
Add a virURIFree method
* src/datatypes.c, src/esx/esx_driver.c, src/libvirt.c,
src/qemu/qemu_migration.c, src/vmx/vmx.c, src/xen/xend_internal.c,
tests/viruritest.c: s/xmlFreeURI/virURIFree/
---
src/datatypes.c | 2 +-
src/esx/esx_driver.c | 2 +-
src/libvirt.c | 4 ++--
src/libvirt_private.syms | 1 +
src/qemu/qemu_migration.c | 2 +-
src/util/viruri.c | 12 ++++++++++++
src/util/viruri.h | 2 ++
src/vmx/vmx.c | 2 +-
src/xen/xend_internal.c | 8 ++++----
tests/viruritest.c | 2 +-
10 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/src/datatypes.c b/src/datatypes.c
index f0b5025..5ad988b 100644
--- a/src/datatypes.c
+++ b/src/datatypes.c
@@ -117,7 +117,7 @@ virReleaseConnect(virConnectPtr conn) {
virResetError(&conn->err);
- xmlFreeURI(conn->uri);
+ virURIFree(conn->uri);
virMutexUnlock(&conn->lock);
virMutexDestroy(&conn->lock);
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 6943534..dbf95f4 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -4072,7 +4072,7 @@ esxDomainMigratePerform(virDomainPtr domain,
result = 0;
cleanup:
- xmlFreeURI(parsedUri);
+ virURIFree(parsedUri);
esxVI_ObjectContent_Free(&virtualMachine);
esxVI_Event_Free(&eventList);
esxVI_ManagedObjectReference_Free(&task);
diff --git a/src/libvirt.c b/src/libvirt.c
index 7f8d42c..f58623a 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -5072,10 +5072,10 @@ virDomainMigratePeer2Peer (virDomainPtr domain,
if (!tempuri->server || STRPREFIX(tempuri->server, "localhost")) {
virLibConnError(VIR_ERR_INVALID_ARG, __FUNCTION__);
virDispatchError(domain->conn);
- xmlFreeURI(tempuri);
+ virURIFree(tempuri);
return -1;
}
- xmlFreeURI(tempuri);
+ virURIFree(tempuri);
/* Perform the migration. The driver isn't supposed to return
* until the migration is complete.
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index e40c80e..7cd6a96 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1469,6 +1469,7 @@ virTypedParameterAssign;
# viruri.h
+virURIFree;
virURIFormat;
it should be after virURIFormat.
ACK with this fixed.