Re: [PATCH 6/8] Introduce generic RPC client objects

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

 



On 12/01/2010 10:26 AM, Daniel P. Berrange wrote:
> To facilitate creation of new clients using XDR RPC services,
> pull alot of the remote driver code into a set of reusable

s/alot/a lot/

> objects.
> 
>  - virNetClient: Encapsulates a socket connection to a
>    remote RPC server. Handles all the network I/O for
>    reading/writing RPC messages. Delegates RPC encoding
>    and decoding to the registered programs
> 
>  - virNetClientProgram: Handles processing and dispatch
>    of RPC messages for a single RPC (program,version).
>    A program can register to receive async events
>    from a client
>  - virNetClientSASLContext: Handles everything todo with
>    SASL authentication and encryption. The callers no
>    longer need directly call any cyrus-sasl APIs, which
>    means error handling is simpler & alternative SASL
>    impls can be provided for Win32
> 
> Each new client program now merely needs to define the list of
> RPC procedures & events it wants and their handlers. It does
> not need to deal with any of the network I/O functionality at
> all.

> +++ b/src/Makefile.am
> @@ -1117,7 +1117,7 @@ libvirt_qemu_la_LIBADD = libvirt.la $(CYGWIN_EXTRA_LIBADD)
>  EXTRA_DIST += $(LIBVIRT_QEMU_SYMBOL_FILE)
>  
>  
> -noinst_LTLIBRARIES += libvirt-net-rpc.la libvirt-net-rpc-server.la
> +noinst_LTLIBRARIES += libvirt-net-rpc.la libvirt-net-rpc-server.la libvirt-net-rpc-client.la

Wrap at 80 columns.

>  
>  libvirt_net_rpc_la_SOURCES = \
>  	../daemon/event.c \
> @@ -1153,6 +1153,18 @@ libvirt_net_server_la_LDFLAGS = \
>  libvirt_net_server_la_LIBADD = \
>  			$(CYGWIN_EXTRA_LIBADD)
>  
> +libvirt_net_client_la_SOURCES = \
> +	rpc/virnetclientsaslcontext.h rpc/virnetclientsaslcontext.c \
> +	rpc/virnetclientprogram.h rpc/virnetclientprogram.c \
> +	rpc/virnetclient.h rpc/virnetclient.c
> +libvirt_net_client_la_CFLAGS = \
> +			$(AM_CFLAGS)
> +libvirt_net_client_la_LDFLAGS = \
> +			$(AM_LDFLAGS) \
> +			$(CYGWIN_EXTRA_LDFLAGS) \
> +			$(MINGW_EXTRA_LDFLAGS)l

s/l$//

> +++ b/src/rpc/virnetclient.c
> @@ -0,0 +1,1237 @@
> +
> +

Copyright header?  Probably affects multiple new files across multiple
of these patches.

> +
> +#ifdef WIN32
> +# define pipe(fds) _pipe(fds,4096, _O_BINARY)
> +#endif

Yuck.  Gnulib should really take care of this for us.  But for now, we
have to keep it.

> +
> +virNetClientPtr virNetClientNewCommand(const char **cmdargv,
> +                                       const char **cmdenv)
> +{

If virNetSocketNewConnectCommand is rewritten around virCommand, then
this should be updated as well.

> +
> +static int virNetClientCallDispatchStream(virNetClientPtr client ATTRIBUTE_UNUSED)
> +{
> +#if 0
> +    struct private_stream_data *privst;

You weren't kidding about this being an incomplete RFC series.

> +#define __VIR_NET_CLIENT_H__

> +
> +#if HAVE_SASL

'make syntax-check' won't like this if you have cppi installed.

Again, mostly okay; just copying existing code and renaming into new
API.  Overall, I'm liking the direction this series is heading.

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

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]