[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 07/13] Turn qemuAgentPtr and qemuMonitorPtr into virObjectPtr instances



On 07/31/2012 10:58 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange redhat com>
> 
> Make qemuAgentPtr and qemuMonitorPtr types use the virObject APIs
> for reference counting
> 
> Signed-off-by: Daniel P. Berrange <berrange 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 redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]