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

Re: [libvirt] [PATCH 3/4] Use a virFreeCallback on virNetSocket to ensure safe release



On 07/19/2011 07:22 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange redhat com>

When unregistering an I/O callback from a virNetSocket object,
there is still a chance that an event may come in on the callback.
In this case it is possible that the virNetSocket might have been
freed already. Make use of a virFreeCallback when registering
the I/O callbacks and hold a reference for the entire time the
callback is set.

* src/rpc/virnetsocket.c: Register a free function for the
   file handle watch
* src/rpc/virnetsocket.h, src/rpc/virnetserverservice.c,
   src/rpc/virnetserverclient.c, src/rpc/virnetclient.c: Add
   a free function for the socket I/O watches
---
  src/rpc/virnetclient.c        |   13 ++++++++++++-
  src/rpc/virnetserverclient.c  |   13 ++++++++++++-
  src/rpc/virnetserverservice.c |   20 ++++++++++++++++++--
  src/rpc/virnetsocket.c        |   30 ++++++++++++++++++++++++++++--
  src/rpc/virnetsocket.h        |    3 ++-
  5 files changed, 72 insertions(+), 7 deletions(-)


ACK.

--
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


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