[libvirt] [PATCH 02/12] Provide a simple object for encoding/decoding RPC messages

Eric Blake eblake at redhat.com
Mon Mar 21 22:14:59 UTC 2011


On 03/18/2011 12:54 PM, Daniel P. Berrange wrote:
> This provides a new struct that contains a buffer for the RPC
> message header+payload, as well as a decoded copy of the message
> header. There is an API for applying a XDR encoding & decoding
> of the message headers and payloads. There are also APIs for
> maintaining a simple FIFO queue of message instances.
> 
> Expected usage scenarios are:
> 
> To send a message
> 
>    msg = virNetMessageNew()
> 
>    ...fill in msg->header fields..
>    virNetMessageEncodeHeader(msg)
>    ...loook at msg->header fields to determine payload filter

s/loook/look/

> +int virNetMessageEncodePayload(virNetMessagePtr msg,
> +                               xdrproc_t filter,
> +                               void *data)
> +    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;

Redundant ATTRIBUTE_NONNULL(2).  Since data is opaque to us, it is
feasible to have a filter that accepts NULL; therefore, just delete the
second instance (and don't change 2 to 3).

> +int virNetMessageDecodePayload(virNetMessagePtr msg,
> +                               xdrproc_t filter,
> +                               void *data)
> +    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;

Likewise.

ACK with those nits fixed.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110321/f12fdcff/attachment-0001.sig>


More information about the libvir-list mailing list