[libvirt] [PATCH v2] lib: Add note that bulk stats API queries may overrun RPC buffers

Martin Kletzander mkletzan at redhat.com
Wed May 24 13:34:06 UTC 2017

On Wed, May 24, 2017 at 01:42:44PM +0100, Richard W.M. Jones wrote:
>On Tue, May 23, 2017 at 05:07:40PM +0200, Michal Privoznik wrote:
>> Because:
>> https://www.redhat.com/archives/libvir-list/2017-May/msg00088.html
>I don't think this is a reason at all.
>Libguestfs uses an RPC system which was modelled on the libvirt one,
>and has exactly the same problem with message size limits, except
>smaller -- 4MB and we've never had to increase it.
>We get around this by batching operations over messages as necessary
>(eg [1]).  This adds a little complexity in the implementation of the
>API, but the point is that the complexity is entirely hidden to users
>of the APIs.
>[1] https://github.com/libguestfs/libguestfs/blob/master/lib/file.c#L375-L415
>In this code, ‘guestfs_impl_lstatnslist’ is the publicly visible API
>(it's the implementation of the public API guestfs_lstatnslist).
>‘guestfs_internal_lstatnslist’ is the message which travels over the
>RPC.  The batching of 1000 requests per message was chosen based on
>pathname limits on Linux so that each request will always fit into a
>single message.

That's basically my point #2 from the RFC/v1 that we could just pass the
data through a virStream (it would have to be as text, which is almost
as bad as virTypedParam).  What you suggest would not be that
difficult, but it sounds to me like something others dismissed, IIRC.

>Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
>Read my programming and virtualization blog: http://rwmj.wordpress.com
>libguestfs lets you edit virtual machines.  Supports shell scripting,
>bindings from many languages.  http://libguestfs.org
>libvir-list mailing list
>libvir-list at redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170524/d9ad60cf/attachment-0001.sig>

More information about the libvir-list mailing list