qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Nbd] Is NBD_CMD_FLAG_FUA valid during NBD_CMD_FLUSH?


From: Eric Blake
Subject: Re: [Qemu-devel] [Nbd] Is NBD_CMD_FLAG_FUA valid during NBD_CMD_FLUSH?
Date: Fri, 1 Apr 2016 09:31:53 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1

On 04/01/2016 09:13 AM, Alex Bligh wrote:
> 
> On 1 Apr 2016, at 16:12, Alex Bligh <address@hidden> wrote:
> 
>> as qemu doesn't use FUA on write and the kernel doesn't use FUA
> 
> "as qemu doesn't use FUA other than on write" - sorry

qemu's block/nbd-client.c currently sends NBD_CMD_FLAG_FUA on
NBD_CMD_FLUSH (unconditionally, if NBD_FLAG_SEND_FUA was advertised),
and on NBD_CMD_WRITE (conditionally: if NBD_FLAG_SEND_FUA was advertised
AND the upper layer requested FUA).  I don't see it being sent on reads,
so on that front, you appear to be correct that no common clients are
expecting any particular behavior on reads.

qemu's nbd/server.c silently ignores NBD_CMD_FLAG_FUA on all commands
except NBD_CMD_READ (conditionally calls blk_co_flush()), NBD_CMD_WRITE
(conditionally calls blk_co_flush()).  Ignoring the flag on
NBD_CMD_FLUSH seems to make sense, since that code unconditionally calls
blk_co_flush(), which is all the more the flag was enabling on
read/write.  And if you are correct that no real clients are sending FUA
on READ, then deleting (or changing) the server support for FUA on read
should have no negative impact.

qemu doesn't yet implement WRITE_ZEROES.

When qemu client is talking to a qemu server, there is no
incompatibility between the two - all client commands that set FUA are
sanely handled by the recipient server code.  But the same is not true
if you pair a current qemu client with current nbd.git server, as the
qemu will unconditionally set FUA on flush, and the server now rejects
it as an invalid flag (thus making it impossible for qemu to flush).  So
we probably ought to fix qemu client to quit unconditionally sending FUA
(no change when qemu client talks to qemu server); and at the same time
out to fix NBD server to silently ignore FUA on flush (fix the breakage
between the pairing).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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