Richard W.M. Jones
2020-Sep-29 11:26 UTC
Re: [Libguestfs] [libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
On Mon, Sep 28, 2020 at 05:05:16PM -0500, Eric Blake wrote:> + "get_meta_context", { > + default_call with > + args = [ Int "i" ]; ret = RString;Previously we have only used the Int parameter type for things which are plausibly integers (timeouts, signal numbers). This one really ought to be an unsigned or better still a size_t. Would it help if I provided a SizeT type for the generator? But in general yes this patch is obvious so ACK. 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
Eric Blake
2020-Sep-29 11:47 UTC
Re: [Libguestfs] [libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
On 9/29/20 6:26 AM, Richard W.M. Jones wrote:> On Mon, Sep 28, 2020 at 05:05:16PM -0500, Eric Blake wrote: >> + "get_meta_context", { >> + default_call with >> + args = [ Int "i" ]; ret = RString; > > Previously we have only used the Int parameter type for things which > are plausibly integers (timeouts, signal numbers). This one really > ought to be an unsigned or better still a size_t. Would it help if I > provided a SizeT type for the generator?If we take SizeT as parameter for this one, we probably want to return an ssize_t for get_nr_meta_contexts, rather than RInt. Does the name RSizeT that returns ssize_t make sense?> > But in general yes this patch is obvious so ACK. > > Rich. >-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Richard W.M. Jones
2020-Sep-29 14:34 UTC
Re: [Libguestfs] [libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
On Tue, Sep 29, 2020 at 06:47:47AM -0500, Eric Blake wrote:> On 9/29/20 6:26 AM, Richard W.M. Jones wrote: > >On Mon, Sep 28, 2020 at 05:05:16PM -0500, Eric Blake wrote: > >>+ "get_meta_context", { > >>+ default_call with > >>+ args = [ Int "i" ]; ret = RString; > > > >Previously we have only used the Int parameter type for things which > >are plausibly integers (timeouts, signal numbers). This one really > >ought to be an unsigned or better still a size_t. Would it help if I > >provided a SizeT type for the generator? > > If we take SizeT as parameter for this one, we probably want to > return an ssize_t for get_nr_meta_contexts, rather than RInt. Does > the name RSizeT that returns ssize_t make sense?Yes we should do this. Rich. -- 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
Seemingly Similar Threads
- Re: [libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
- [libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
- [PATCH libnbd] DO NOT PUSH: Update api: Add get_nr_meta_contexts, clear_meta_contexts
- [libnbd PATCH 3/3] api: Add nbd_opt_list_meta_context
- [libnbd PATCH 0/3] opt_list_meta_context