Re: [Libguestfs] [libnbd PATCH v2 11/13] api: Add nbd_aio_opt_list

Richard W.M. Jones
Mon, 17 Aug 2020 11:19:13 -0000

On Fri, Aug 14, 2020 at 05:00:30PM -0500, Eric Blake
wrote:
> +let list_closure = {
> +  cbname = "list";
> +  cbargs = [ CBString "name"; CBString "description" ]
> +}

This is fine assuming we're certain that NBD_OPT_LIST / NBD_REP_SERVER
(in the protocol) cannot be extended with more fields.  Otherwise I'd
suggesting adding some kind id/cookie here which the caller could use
to get "further information", but would be useless at the moment.

NBD_OPT_LIST is documented as returning NBD_REP_SERVER replies, and
not anything else.  The NBD protocol documentation tries to give
wiggle room for NBD_REP_SERVER but is also clear that the extra field
is a description field for user display, and I guess we're all using
it for that now.

It seems therefore that NBD_OPT_LIST cannot be extended, and so
another option would have to be introduced in future, in which case we
would support that option either by needing to extend this API or by a
new API (aio_list2 or something).

On balance therefore, this seems fine.

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.