qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wouter Verhelst <w@uter.be>
To: Eric Blake <eblake@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	nbd-general@lists.sourceforge.net, kwolf@redhat.com,
	den@virtuozzo.com, stefanha@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [Nbd] [PATCH] proto: add 'shift' extension.
Date: Tue, 27 Sep 2016 01:41:32 +0200	[thread overview]
Message-ID: <20160926234132.xllehw4ib434ness@grep.be> (raw)
In-Reply-To: <7193be9e-4155-c5dc-282e-55ab1cf5f231@redhat.com>

On Mon, Sep 26, 2016 at 03:21:46PM -0500, Eric Blake wrote:
> I'd much rather support a single flag that says to zero the entire disk
> than to introduce stateful variable-amount shifting.

That's almost exactly the opposite of what I said :)

Now, I don't feel very strong either way, but what matters to me is:

- NBD is a simple, easy to understand protocol; that is a feature, and
  so it should remain that way.
- Every time we add another option, flag, or command, we make the
  protocol slightly more complex, which is counter to that goal.
- Adding a command with a single use case (i.e., a "wipe the whole
  device" command) seems like it would not see much use, except perhaps
  in the use case that Virtuozzo is thinking about. In other words, it
  makes things slightly more complex for little benefit.

I thought a negotiated shift size could be creatively used for other
things beyond just "wipe the whole disk" commands, and that it might be
elegant in that way. On the other hand, I recognize that adding state in
that manner also complicates the protocol in that an observer which sees
only part of the traffic may not understand what's going on anymore.

So let's just say that an NBD_CMD_FLAG_SHIFT would:
- Left-shift the size by 16 bits; no more, no less
  - 2^32-1 is too large a granularity for this to be useful beyond "wipe
    whole disk" commands; 2^16-1 (65535) seems like a more useful
    granularity.
  - This allows for a maximum number of 2^48-1 bytes (one byte shy of
    256 tebibytes) to be affected by a single command, which seems
    sufficient for the given purpose.
  - If someone really wants to wipe 2^64-1 bytes (i.e., 16 exbibytes),
    they are probably using the wrong tools.
- Be only valid for commands that don't send or expect data to be sent
  out over the wire.
  - currently TRIM and WRITE_ZEROES, but not READ or WRITE.

Thoughts?

-- 
< ron> I mean, the main *practical* problem with C++, is there's like a dozen
       people in the world who think they really understand all of its rules,
       and pretty much all of them are just lying to themselves too.
 -- #debian-devel, OFTC, 2016-02-12

  reply	other threads:[~2016-09-26 23:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-26 12:46 [Qemu-devel] [PATCH] proto: add 'shift' extension Vladimir Sementsov-Ogievskiy
2016-09-26 12:51 ` Paolo Bonzini
2016-09-26 13:53   ` Vladimir Sementsov-Ogievskiy
2016-09-26 13:54     ` Paolo Bonzini
2016-09-26 14:06       ` Alex Bligh
2016-09-26 20:35   ` Eric Blake
2016-09-26 14:05 ` Alex Bligh
2016-09-26 20:21 ` Eric Blake
2016-09-26 23:41   ` Wouter Verhelst [this message]
2016-09-27  7:36     ` [Qemu-devel] [Nbd] " Alex Bligh
2016-09-27  9:43 ` [Qemu-devel] " Denis V. Lunev
2016-09-27 10:15   ` Paolo Bonzini
2016-09-27 10:25     ` Denis V. Lunev
2016-09-27 12:07       ` Paolo Bonzini
2016-09-27 13:28         ` Denis V. Lunev
2016-09-27 17:04           ` Paolo Bonzini
2016-09-27 18:59             ` Denis V. Lunev
2016-09-28  8:34               ` Kevin Wolf
2016-09-28  8:37                 ` Denis V. Lunev
2016-09-28  8:56                   ` Kevin Wolf
2016-09-28  9:00                     ` Vladimir Sementsov-Ogievskiy
2016-09-28  9:32                       ` Kevin Wolf
2016-09-27 13:46         ` Denis V. Lunev

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=20160926234132.xllehw4ib434ness@grep.be \
    --to=w@uter.be \
    --cc=den@virtuozzo.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=nbd-general@lists.sourceforge.net \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@virtuozzo.com \
    /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).