qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 11/11] nbd: Minimal structured read for clien


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v5 11/11] nbd: Minimal structured read for client
Date: Tue, 24 Oct 2017 02:31:14 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 10/19/2017 05:26 PM, Eric Blake wrote:
> From: Vladimir Sementsov-Ogievskiy <address@hidden>
> 
> 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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]