On 10/19/2017 05:26 PM, Eric Blake wrote: > From: Vladimir Sementsov-Ogievskiy <[email protected]> > > Minimal implementation: for structured error only error_report error > message. >
> +
> + /* In-out fields, set by client before nbd_receive_negotiate() and
> + * updated by server results during nbd_receive_negotiate() */
> + bool structured_reply;
> +
> +++ b/nbd/client.c
> @@ -685,6 +685,16 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char
> *name,
> if (fixedNewStyle) {
> int result;
>
> + if (info->structured_reply) {
> + result = nbd_request_simple_option(ioc,
> + NBD_OPT_STRUCTURED_REPLY,
> + errp);
> + if (result < 0) {
> + goto fail;
> + }
> + info->structured_reply = result == 1;
> + }
> +
Another bug fix: if we are not fixedNewStyle, then the client cannot
request structured_reply from the server, so we must clear
info->structure_reply before returning to the client. Fixing that
cleans up a lot of the iotests failures (since iotests tends to run
old-style servers that cannot negotiate options - maybe we should
improve that, since newstyle is better, but that's a task for another day).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
