• D
    Introduce generic RPC server objects · 4e00b1da
    Daniel P. Berrange 提交于
    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.
    4e00b1da
virnetserverprogram.c 13.6 KB