On 04/05/2016 09:00 AM, Alex Bligh wrote: > > On 5 Apr 2016, at 14:49, Eric Blake <eblake@...696...> wrote: > >> Or are you proposing that you could use either NBD_OPT_SELECT followed >> by NBD_OPT_GO (no name), OR use NBD_OPT_GO+name (no NBD_OPT_SELECT), >> both as new ways to exit the handshake phase while still keeping the >> door open for error reporting? Okay, then in that case, it would allow >> one less back-and-forth between client and server if NBD_OPT_GO can >> include an optional name. > > This > >> But how does it play with the special case of >> "" as the name of the default export? > > NBD_OPT_EXPORT_NAME with name="" selects default export > > NBD_OPT_SELECT with name="" selects default export and returns > the name of the default export > > NBD_OPT_GO with name="" selects the previously selected > NBD_OPT_SELECT (if one was selected), else the default export. A bit confusing, but I could live with it (especially since I'm not done with my qemu port yet). Post a doc patch, and I'd be glad to review it. > >> NBD_OPT_SELECT can gracefully >> handle the empty name as selecting the default export, but NBD_OPT_GO >> would be ambiguous as to whether you are using it without a name option, >> or if you are using the optional name option to explicitly select the >> default export. > > It depends whether you did a SELECT first. I'm a bit worried about the sequence of: NBD_OPT_SELECT (name): succeeds NBD_OPT_STARTTLS NBD_OPT_GO (no name) The first SELECT means that I want to visit 'name', and the server succeeds because it is willing to offer the export without TLS. But then I go ahead and negotiate TLS anyways, which wipes out the current selection. The spec, as currently written, says the NBD_OPT_GO will fail (I have no current selection); but by your proposal, it says I now want to visit the default export (which may be different than the export for name), and let me succeed. Then again, you could argue that any client smart enough to do NBD_OPT_STARTTLS and NBD_OPT_GO should know to renegotiate or to use NBD_OPT_GO(name from earlier select), so it's only a weak objection, where adequate documentation may be sufficient. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature