[libvirt] [PATCH 07/13] Turn qemuAgentPtr and qemuMonitorPtr into virObjectPtr instances
Eric Blake
eblake at redhat.com
Fri Aug 3 23:41:37 UTC 2012
On 07/31/2012 10:58 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> Make qemuAgentPtr and qemuMonitorPtr types use the virObject APIs
> for reference counting
>
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
> src/qemu/qemu_agent.c | 86 ++++++++++++++++++-----------------------
> src/qemu/qemu_agent.h | 3 --
> src/qemu/qemu_domain.c | 22 +++++------
> src/qemu/qemu_monitor.c | 97 ++++++++++++++++++++---------------------------
> src/qemu/qemu_monitor.h | 3 --
> 5 files changed, 89 insertions(+), 122 deletions(-)
These diffstats are showing that this is a good move.
> @@ -791,12 +778,13 @@ qemuAgentOpen(virDomainObjPtr vm,
> VIR_EVENT_HANDLE_WRITABLE :
> 0),
> qemuAgentIO,
> - mon, qemuAgentUnwatch)) < 0) {
> + mon,
> + (virFreeCallback)virObjectUnref)) < 0) {
Should virobject.h provide something like
static inline void
virObjectFreeCallback(void *opaque) { virObjectUnref(opaque); }
just so that we don't have to cast virObjectUnref in so many places?
ACK.
--
Eric Blake eblake at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120803/5067b4be/attachment-0001.sig>
More information about the libvir-list
mailing list