[Libguestfs] [libnbd PATCH v2 06/13] api: Add nbd_opt_abort and nbd_aio_opt_abort

Eric Blake eblake at redhat.com
Mon Aug 17 13:30:32 UTC 2020


On 8/17/20 6:06 AM, Richard W.M. Jones wrote:
> On Fri, Aug 14, 2020 at 05:00:25PM -0500, Eric Blake wrote:
>> diff --git a/lib/internal.h b/lib/internal.h
>> index 5f495fb..03baacd 100644
>> --- a/lib/internal.h
>> +++ b/lib/internal.h
>> @@ -101,6 +101,7 @@ struct nbd_handle {
>>
>>     /* Option negotiation mode. */
>>     bool opt_mode;
>> +  uint8_t current_opt;
> 
> Be nice to add a comment here about what current_opt can contain,
> which would also explain why it has this somewhat unexpected type.
> Something like:
> 
> +  uint8_t current_opt;    /* 0 or NBD_OPT_* */

Sure, makes sense.

> 
> (Can it only contain NBD_OPT_ABORT or are other options added in later
> patches?)

Correct - later patches add NBD_OPT_ABORT, NBD_OPT_GO, NBD_OPT_LIST, and 
NBD_OPT_INFO.  I've also thought about, but haven't yet coded anything, 
for also giving the user control over NBD_OPT_STARTTLS (for tls=1 
connections), NBD_OPT_STRUCTURED_REPLIES (mainly for interoperability 
testing), and NBD_OPT_INFO_META_CONTEXT.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




More information about the Libguestfs mailing list