aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* maint: fix up copyright notice inconsistenciesEric Blake2012-09-201-1/+1
| | | | | | | | | https://www.gnu.org/licenses/gpl-howto.html recommends that the 'If not, see <url>.' phrase be a separate sentence. * tests/securityselinuxhelper.c: Remove doubled line. * tests/securityselinuxtest.c: Likewise. * globally: s/; If/. If/
* Add support for creating sockets & RPC servers from a pre-opened fdDaniel P. Berrange2012-08-201-0/+49
| | | | | | In order to support systemd socket based activation, it needs to be possible to create virNetSocketPtr and virNetServerServicePtr instance from a pre-opened file descriptor
* Change interaction when accepting new RPC client connectionsDaniel P. Berrange2012-08-151-23/+15
| | | | | | | | | | | Currently the virNetServerServicePtr is responsible for creating the virNetServerClientPtr instance when accepting a new connection. Change this so that the virNetServerServicePtr merely gives virNetServerPtr a virNetSocketPtr instance. The virNetServerPtr can then create the virNetServerClientPtr as it desires Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Turn virNetServer* into virObject instancesDaniel P. Berrange2012-08-071-44/+39
| | | | | | | Make all the virNetServer* objects use the virObject APIs for reference counting Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Turn virSocket into a virObjectDaniel P. Berrange2012-08-071-2/+2
| | | | | | Make virSocket use the virObject APIs for reference counting Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Turn virNetTLSContext and virNetTLSSession into virObject instancesDaniel P. Berrange2012-08-071-7/+3
| | | | | | | Make virNetTLSContext and virNetTLSSession use the virObject APIs for reference counting Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Desert the FSF address in copyrightOsier Yang2012-07-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | Per the FSF address could be changed from time to time, and GNU recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html) You should have received a copy of the GNU General Public License along with Foobar. If not, see <http://www.gnu.org/licenses/>. This patch removes the explicit FSF address, and uses above instead (of course, with inserting 'Lesser' before 'General'). Except a bunch of files for security driver, all others are changed automatically, the copyright for securify files are not complete, that's why to do it manually: src/security/security_selinux.h src/security/security_driver.h src/security/security_selinux.c src/security/security_apparmor.h src/security/security_apparmor.c src/security/security_driver.c
* Support changing UNIX socket owner in virNetSocketNewListenUNIXJiri Denemark2011-08-151-0/+1
| | | | This patch allows owner's UID to be changed as well.
* Add backlog parameter to virNetSocketListenJiri Denemark2011-08-151-2/+2
| | | | So that callers can change the default value.
* daemon: Unlink unix socket paths on shutdownOsier Yang2011-08-041-0/+12
| | | | | | | | | | This patch introduces a internal RPC API "virNetServerClose", which is standalone with "virNetServerFree". it closes all the socket fds, and unlinks the unix socket paths, regardless of whether the socket is still referenced or not. This is to address regression bug: https://bugzilla.redhat.com/show_bug.cgi?id=725702
* Use a virFreeCallback on virNetSocket to ensure safe releaseDaniel P. Berrange2011-07-191-2/+18
| | | | | | | | | | | | | | | 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
* rpc: avoid memory leak on errorEric Blake2011-07-041-1/+6
| | | | | | | Detected by Coverity. The leak is on an error path, but I'm not sure whether that path is likely to be triggered in practice. * src/rpc/virnetserverservice.c (virNetServerServiceAccept): Plug leak.
* Fix hardcoded limit on client requests in RPC codeDaniel P. Berrange2011-06-301-0/+6
| | | | | | | | | | | | | The virNetServerClient object had a hardcoded limit of 10 requests per client. Extend constructor to allow it to be passed in as a configurable variable. Wire this up to the 'max_client_requests' config parameter in libvirtd * daemon/libvirtd.c: Pass max_client_requests into services * src/rpc/virnetserverservice.c, src/rpc/virnetserverservice.h: Pass nrequests_client_max to clients * src/rpc/virnetserverclient.c, src/rpc/virnetserverclient.h: Allow configurable request limit
* Introduce generic RPC module for advertising via MDNSDaniel P. Berrange2011-06-241-0/+8
| | | | | | | | | | | | | | Allow RPC servers to advertise themselves using MDNS, via Avahi * src/rpc/virnetserver.c, src/rpc/virnetserver.h: Allow registration of MDNS services via avahi * src/rpc/virnetserverservice.c, src/rpc/virnetserverservice.h: Add API to fetch the listen port number * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add API to fetch the local port number * src/rpc/virnetservermdns.c, src/rpc/virnetservermdns.h: Represent an MDNS advertisement
* Introduce generic RPC server objectsDaniel P. Berrange2011-06-241-0/+247
To facilitate creation of new daemons providing XDR RPC services, pull a lot of the libvirtd daemon code into a set of reusable objects. * virNetServer: A server contains one or more services which accept incoming clients. It maintains the list of active clients. It has a list of RPC programs which can be used by clients. When clients produce a complete RPC message, the server passes this onto the corresponding program for handling, and queues any response back with the client. * virNetServerClient: Encapsulates a single client connection. All I/O for the client is handled, reading & writing RPC messages. * virNetServerProgram: Handles processing and dispatch of RPC method calls for a single RPC (program,version). Multiple programs can be registered with the server. * virNetServerService: Encapsulates socket(s) listening for new connections. Each service listens on a single host/port, but may have multiple sockets if on a dual IPv4/6 host. Each new daemon now merely has to define the list of RPC procedures & their handlers. It does not need to deal with any network related functionality at all.