From: "Denis V. Lunev" <den@openvz.org>
To: Eric Blake <eblake@redhat.com>, Alex Bligh <alex@alex.org.uk>
Cc: "nbd-general@lists.sourceforge.net"
<nbd-general@lists.sourceforge.net>,
Kevin Wolf <kwolf@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Pavel Borzenkov <pborzenkov@virtuozzo.com>,
"Stefan stefanha@redhat. com" <stefanha@redhat.com>,
Wouter Verhelst <w@uter.be>, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [Nbd] [PATCH v2] doc: Add NBD_CMD_BLOCK_STATUS extension
Date: Tue, 5 Apr 2016 00:04:34 +0300 [thread overview]
Message-ID: <5702D6E2.1090901@openvz.org> (raw)
In-Reply-To: <5702D279.6080905@redhat.com>
On 04/04/2016 11:45 PM, Eric Blake wrote:
> On 04/04/2016 02:27 PM, Denis V. Lunev wrote:
>> On 04/04/2016 11:15 PM, Alex Bligh wrote:
>>> On 4 Apr 2016, at 21:13, Denis V. Lunev <den@openvz.org> wrote:
>>>
>>>> As far as I remember that text we have had a number in request
>>>> specifying which bitmap to query and the server should reply with one
>>>> bitmap at a time.
>>>>
>>>> Would this work for you?
>>> I think that would be much better, yes, though I'd suggest the
>>> bitmap had an ID other than a number 0..15 so other people
>>> can use it too.
>>>
>> bitmap requires to negotiate granularity which is
>> not that easy thing.
>>
>> If we have different granularities for 'dirty' and 'allocated'
>> bitmaps and we can report this using this proto and
>> can not do this cleanly with bitmap approach assuming
>> that we will add 'NBD_STATE_DIRTY_DEALLOCATED' (0x2) state
> I'm not sure what you are trying to propose adding here. 'state' is a
> bitmap - it is either a representation of two bits of information
> (NBD_CMD_FLAG_DIRTY was clear, so state is the bitwise OR of
> NBD_STATE_HOLE and NBD_STATE_ZERO), or the representation of one bit of
> information (NBD_CMD_FLAG_DIRTY was set, so state is the bitwise OR of
> NBD_STATE_CLEAN).
sorry for vague description. I have messed up.
In v1 we have had 'status' field, which can have the
following values for dirty request:
+ - `NBD_STATE_DIRTY` (0x0), LBA extent is dirty;
+ - `NBD_STATE_CLEAN` (0x1), LBA extent is clean.
in the extent structure:
+ * 64 bits, offset (unsigned)
+ * 32 bits, length (unsigned)
+ * 16 bits, status (unsigned)
with an additional NBD_STATE_DIRTY_HOLE or (DIRTY_DEALLOCATED)
we could report the entire state using one query. The user could be
able to read entire state which is useful for backup at once.
Your current proposal is more tricky and it was misunderstood by Alex:
+ * 32 bits, status flags
and you describe flags as
+ - `NBD_STATE_HOLE` (bit 0); if set, the block represents a hole
+ (and future writes to that area may cause fragmentation or
+ encounter an `ENOSPC` error); if clear, the block is allocated
+ or the server could not otherwise determine its status. Note
+ that the use of `NBD_CMD_TRIM` is related to this status, but
+ that the server MAY report a hole even where trim has not been
+ requested, and also that a server MAY report allocation even
+ where a trim has been requested.
+ - `NBD_STATE_ZERO` (bit 1), if set, the block contents read as
+ all zeroes; if clear, the block contents are not known. Note
+ that the use of `NBD_CMD_WRITE_ZEROES` is related to this
+ status, but that the server MAY report zeroes even where write
+ zeroes has not been requested, and also that a server MAY
+ report unknown content even where write zeroes has been
+ requested.
+ - `NBD_STATE_CLEAN` (bit 2); if set, the block represents a
+ portion of the file that is still clean because it has not
+ been written; if clear, the block represents a portion of the
+ file that is dirty, or where the server could not otherwise
+ determine its status.
and opinion of Alex was that all 3 bits could be set in reply to
NBD_CMD_BLOCK_STATUS
with NBD_CMD_FLAG_STATUS_DIRTY set.
This confused him. This confuses me too.
If allocated state is not replied to command with NBD_CMD_FLAG_STATUS_DIRTY
then why to have different meaning of bits.
> I'm not sure where you are reading into this that granularity has to be
> negotiated. The client never mentions granularity; and the server is
> perfectly free to report data in descriptors as large or as small as it
> wants (although I did document that the server SHOULD stick to
> descriptors that are at least 512 bytes at a time, and SHOULD coalese
> descriptors so that two consecutive descriptors have distinct state values).
>
> Whether something is allocated or not has no direct bearing on whether
> it is dirty or not; and it is feasible that a server could report the
> act of NBD_CMD_TRIM as causing a portion of the file to become dirty.
>
next prev parent reply other threads:[~2016-04-04 21:04 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 16:39 [Qemu-devel] [PATCH v2] doc: Add NBD_CMD_BLOCK_STATUS extension Eric Blake
2016-04-04 18:06 ` [Qemu-devel] [Nbd] " Alex Bligh
2016-04-04 19:34 ` Eric Blake
2016-04-04 19:54 ` Denis V. Lunev
2016-04-04 20:03 ` Alex Bligh
2016-04-04 20:08 ` Denis V. Lunev
2016-04-04 20:34 ` Eric Blake
2016-04-04 21:06 ` Denis V. Lunev
2016-04-04 21:12 ` Alex Bligh
2016-04-05 14:15 ` Paolo Bonzini
2016-04-05 15:01 ` Alex Bligh
2016-04-05 15:23 ` Paolo Bonzini
2016-04-05 15:27 ` Alex Bligh
2016-04-05 15:31 ` Paolo Bonzini
2016-04-04 23:08 ` Wouter Verhelst
2016-04-04 23:32 ` Eric Blake
2016-04-05 7:16 ` Wouter Verhelst
2016-04-05 21:44 ` Wouter Verhelst
2016-04-05 7:13 ` Alex Bligh
2016-04-04 19:58 ` Alex Bligh
2016-04-04 20:04 ` Denis V. Lunev
2016-04-04 20:08 ` Alex Bligh
2016-04-04 20:13 ` Denis V. Lunev
2016-04-04 20:15 ` Alex Bligh
2016-04-04 20:27 ` Denis V. Lunev
2016-04-04 20:45 ` Eric Blake
2016-04-04 21:04 ` Denis V. Lunev [this message]
2016-04-04 21:12 ` Alex Bligh
2016-04-04 21:17 ` Eric Blake
2016-04-04 21:27 ` Denis V. Lunev
2016-04-04 20:26 ` Eric Blake
2016-04-04 21:07 ` Alex Bligh
2016-04-04 21:25 ` Eric Blake
2016-04-04 22:06 ` Alex Bligh
2016-04-04 20:22 ` Eric Blake
2016-04-05 13:38 ` Paolo Bonzini
2016-04-04 22:40 ` Wouter Verhelst
2016-04-04 23:03 ` Eric Blake
2016-04-05 13:41 ` Paolo Bonzini
2016-04-06 5:57 ` Denis V. Lunev
2016-04-06 14:08 ` Eric Blake
2016-04-05 4:05 ` [Qemu-devel] " Kevin Wolf
2016-04-05 13:43 ` Paolo Bonzini
2016-04-07 10:38 ` Vladimir Sementsov-Ogievskiy
2016-04-07 16:10 ` Eric Blake
2016-04-07 16:21 ` [Qemu-devel] [Nbd] " Alex Bligh
2016-04-08 11:35 ` [Qemu-devel] " Kevin Wolf
2016-04-09 9:08 ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-04-13 12:38 ` [Qemu-devel] " Pavel Borzenkov
2016-04-13 14:40 ` Eric Blake
2016-04-07 15:35 ` Pavel Borzenkov
2016-04-07 15:43 ` Paolo Bonzini
2016-04-05 8:51 ` Stefan Hajnoczi
2016-04-05 9:24 ` [Qemu-devel] [Nbd] " Markus Pargmann
2016-04-05 13:50 ` Paolo Bonzini
2016-04-11 5:58 ` Markus Pargmann
2016-04-05 14:14 ` Eric Blake
2016-04-05 20:50 ` Wouter Verhelst
2016-04-11 6:07 ` Markus Pargmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5702D6E2.1090901@openvz.org \
--to=den@openvz.org \
--cc=alex@alex.org.uk \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=nbd-general@lists.sourceforge.net \
--cc=pbonzini@redhat.com \
--cc=pborzenkov@virtuozzo.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=w@uter.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).