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

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

 



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

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@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]