[Libguestfs] [PATCH libnbd] generator: Add SizeT type, maps to C size_t.

Richard W.M. Jones rjones at redhat.com
Thu Oct 1 07:32:00 UTC 2020


On Wed, Sep 30, 2020 at 08:40:52PM -0500, Eric Blake wrote:
> On 9/29/20 6:46 AM, Richard W.M. Jones wrote:
> > ---
> >  generator/API.ml    |  1 +
> >  generator/API.mli   |  1 +
> >  generator/C.ml      | 14 ++++++++++----
> >  generator/GoLang.ml |  5 +++++
> >  generator/OCaml.ml  |  5 +++++
> >  generator/Python.ml | 11 +++++++++--
> >  6 files changed, 31 insertions(+), 6 deletions(-)
> 
> Looks good, and I'll push a counterpart patch adding RSizeT for
> returning ssize_t values.
> 
> Question: Should nbd_opt_list() return RSizeT instead of RInt, as it is
> returning a count of times the callback was called? The same question
> would apply to my upcoming nbd_opt_list_meta_context().  Changing a
> return type from 'int' to 'ssize_t' can result in an ABI change (32- vs.
> 64-bit return on some platforms), which may be too risky, even though
> 1.4 is still fairly new that we are unlikely to break anyone in practice.

No, I don't think we should break 1.4 users.

We could modify the generator to do something with ELF symbol
versioning and use that to clean up the API in future.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the Libguestfs mailing list