qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH for-4.0] nbd: Permit simple error to NBD_CMD_BLO


From: Eric Blake
Subject: Re: [Qemu-block] [PATCH for-4.0] nbd: Permit simple error to NBD_CMD_BLOCK_STATUS
Date: Sat, 23 Mar 2019 09:48:17 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

On 3/23/19 9:40 AM, Richard W.M. Jones wrote:
> On Sat, Mar 23, 2019 at 09:24:55AM -0500, Eric Blake wrote:
>> The NBD spec is clear that when structured replies are active, a
>> simple error reply is acceptable to any command except for
>> NBD_CMD_READ.  However, we were mistakenly requiring structured errors
>> for NBD_CMD_BLOCK_STATUS, and hanging up on a server that gave a
>> simple error (since qemu does not behave as such a server, we didn't
>> notice the problem until now).  Broken since its introduction in
>> commit 78a33ab5 (v2.12).
>>
>> Howeve, even if we had gotten it correct to accept simple errors back
> 
> "However"
> 
>> then, we run into another problem: the client treats the server's
>> reply as fatal and hangs up on the connection, instead of merely
>> failing the block status request but being ready for the next
>> command. Broken in commit 7f86068d (unreleased).
> 
> This latter part fixes the silent qemu client disconnection that
> happens when the server sends back a large number of extents in a
> single block status reply?

Not sure - our mails crossed, so I have not reproduced that failure mode
yet to know if this patch helps there, or if I'll need another patch.

> 
>> Signed-off-by: Eric Blake <address@hidden>
>> ---
>>
>> I confirmed that when backporting things for qemu 2.12 through 3.1,
>> the first hunk is sufficient to let clients tolerate a simple error
>> without hanging up (the second hunk is only required for the 4.0 code
>> base).
>>
>> Rich - if you choose to make nbdkit work around the qemu 2.12 bug
>> where it refuses to communicate with a server that supports
>> NBD_OPT_SET_META_CONTEXT but not base:allocation, you'll also want to
>> make sure that you send a structured error instead of a simple error
>> to any failures of NBD_CMD_BLOCK_STATUS.
> 
> OK, got it.  However I think I'd prefer to see how it goes fixing qemu
> in RHEL 7 first.

Indeed, if RHEL 7 picks up the various NBD patches from qemu 2.12
onwards, it will probably pick up this one as well, at which point
nbdkit shouldn't have to worry about workarounds.

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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