From: Wouter Verhelst <w@uter.be>
To: Eric Blake <eblake@redhat.com>
Cc: Bob Chen <a175818323@gmail.com>,
Stefan Hajnoczi <stefanha@gmail.com>,
"nbd-general@lists.sourceforge.net"
<nbd-general@lists.sourceforge.net>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
qemu block <qemu-block@nongnu.org>
Subject: Re: [Qemu-devel] [Nbd] [Qemu-block] How to online resize qemu disk with nbd protocol?
Date: Sat, 14 Jan 2017 15:45:00 +0100 [thread overview]
Message-ID: <20170114144500.oxoqvrn5x4sdfo74@grep.be> (raw)
In-Reply-To: <90b32a89-6dd8-1f83-4f6f-01bb5479252e@redhat.com>
Hi Eric,
(side note: my mutt tells me that the signature on your message does not
validate. Not sure what's going on, but something you might want to look
into...)
On Thu, Jan 12, 2017 at 12:45:56PM -0600, Eric Blake wrote:
> For resize smaller, things are a lot trickier - how do you block access
> to a portion of a file that the client still thinks exist, but which the
> server has truncated away? Maybe the easy way out is to state that the
> server MUST NOT resize smaller.
I would prefer something along the lines of "the server MUST NOT
activate the 'resize smaller' command (which it received out of band
from whereever) until the client asked for and was told the new size of
the device."
That is (with A & X being offsets, and B & Y being sizes, A+B < X):
client server server mgmt
READ A,B no error
resize to X
READ X,Y no error
reread sizes
READ X,Y ENOSPC
READ A,B no error
In that scenario, it should be the responsibility of the server to
ensure there are no more readers; servers could implement that (if they
don't want to do the required bookkeeping and keep such requests as
pending) by simply sending ESHUTDOWN or some such.
> > What about an active `resize` request from the client? Considering some NBD
> > servers might have the capability to do instant resizing, not applying to
> > LVM or host block device, of course...
>
> And perhaps the 're-read size' command can serve a dual purpose. Since
> all NBD commands already include space for size and offset parameters,
> we could define that if the client passes 0/0 for size and offset, it
> wants to read the server's current size; if it passes 0/non-zero, it is
> asking the server to resize to the new non-zero size (and the server's
> success or error response tells whether the resize happened).
I agree with Alex that adding an active resize command to the NBD
protocol feels like a layering violation. We should probably not do
that.
> Should I spend time turning this idea into a more formal spec, along the
> lines of other NBD extension proposals?
Feel free.
--
< 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
next prev parent reply other threads:[~2017-01-14 14:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 10:22 [Qemu-devel] How to online resize qemu disk with nbd protocol? Bob Chen
2017-01-12 14:43 ` Eric Blake
2017-01-12 15:44 ` [Qemu-devel] [Nbd] " Alex Bligh
2017-01-12 16:54 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-01-12 17:57 ` Bob Chen
2017-01-12 18:45 ` Eric Blake
2017-01-12 18:56 ` Alex Bligh
2017-01-14 14:48 ` [Qemu-devel] [Nbd] [Qemu-block] " Wouter Verhelst
2017-01-14 15:30 ` Alex Bligh
2017-01-14 14:45 ` Wouter Verhelst [this message]
2017-01-16 19:36 ` Eric Blake
2017-01-18 8:01 ` Wouter Verhelst
2017-01-22 10:25 ` Bob Chen
2017-01-22 11:43 ` Wouter Verhelst
2017-01-23 14:54 ` Eric Blake
2017-01-23 15:27 ` Alex Bligh
2017-01-25 8:47 ` Wouter Verhelst
2017-11-14 16:41 ` Eric Blake
2017-11-14 17:37 ` Wouter Verhelst
2017-11-14 19:06 ` Eric Blake
2017-11-16 9:51 ` Wouter Verhelst
2017-11-16 15:30 ` Eric Blake
2017-11-16 16:20 ` Wouter Verhelst
2017-11-23 11:42 ` Wouter Verhelst
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=20170114144500.oxoqvrn5x4sdfo74@grep.be \
--to=w@uter.be \
--cc=a175818323@gmail.com \
--cc=eblake@redhat.com \
--cc=nbd-general@lists.sourceforge.net \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).