[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/11/2012 07:35 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>
> ---

> @@ -791,12 +778,13 @@ qemuAgentOpen(virDomainObjPtr vm,
>                                           VIR_EVENT_HANDLE_WRITABLE :
>                                           0),
>                                          qemuAgentIO,
> -                                        mon, qemuAgentUnwatch)) < 0) {
> +                                        mon,
> +                                        (virFreeCallback)virObjectUnref)) < 0) {

I think you're treading on thin water with regards to C99 definedness,
but in practice, I'm guessing it is safe to cast a function returning
bool to a function returning void (that is, the person calling this
callback thinks it is calling a void function, so it will ignore the
fact that a value was actually returned).  The alternative is to write a
one-line wrapper around virObjectUnref that sanitizes the return value.

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]