diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2012-07-31 17:55:36 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2012-08-07 11:47:41 +0100 |
commit | 46ec5f85c893b0d63ce8bdd6f02c0aeb99373d3b (patch) | |
tree | 96ae063e9d9d41aa7212dcd46b522cb27258f069 /src/xen | |
parent | Add a generic reference counted virObject type (diff) | |
download | libvirt-46ec5f85c893b0d63ce8bdd6f02c0aeb99373d3b.tar.gz libvirt-46ec5f85c893b0d63ce8bdd6f02c0aeb99373d3b.tar.bz2 libvirt-46ec5f85c893b0d63ce8bdd6f02c0aeb99373d3b.zip |
Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:
virConnectPtr
virDomainPtr
virDomainSnapshotPtr
virInterfacePtr
virNetworkPtr
virNodeDevicePtr
virNWFilterPtr
virSecretPtr
virStreamPtr
virStorageVolPtr
virStoragePoolPtr
The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.
* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
src/qemu/qemu_process.c, src/storage/storage_driver.c,
src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
to use virObjectUnref/virObjectRef
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'src/xen')
-rw-r--r-- | src/xen/xend_internal.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index 9c27933fb..892d0e5ef 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -1236,8 +1236,7 @@ sexpr_to_domain(virConnectPtr conn, const struct sexpr *root) error: virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("failed to parse Xend domain information")); - if (ret != NULL) - virUnrefDomain(ret); + virObjectUnref(ret); return NULL; } @@ -2600,7 +2599,7 @@ xenDaemonCreateXML(virConnectPtr conn, const char *xmlDesc, /* Make sure we don't leave a still-born domain around */ if (dom != NULL) { xenDaemonDomainDestroyFlags(dom, 0); - virUnrefDomain(dom); + virObjectUnref(dom); } virDomainDefFree(def); return NULL; |