All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Guillaume Vincke <guillaume.vincke@ovhcloud.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	 vsementsov@yandex-team.ru, kwolf@redhat.com, hreitz@redhat.com,
	stefanha@redhat.com, fam@euphon.net, nbd@other.debian.org
Subject: Re: [PATCH 0/5] block/nbd: Fix block resize on idle device
Date: Thu, 19 Nov 2026 10:20:06 -0600	[thread overview]
Message-ID: <av8d_ufYpxKMw4qk@redhat.com> (raw)
In-Reply-To: <20261119144632.232457-1-guillaume.vincke@ovhcloud.com>

[cc NBD list for a protocol discussion]

On Thu, Nov 19, 2026 at 03:46:27PM +0100, Guillaume Vincke wrote:
> When using an NBD backed device, the size is exchanged during
> handshake. Therefore, when a volume gets resized on the target, it
> closes its clients' connections to force a new handshake. Then,
> management like OpenStack calls the block_resize QMP command to update
> the node size.
> This method works on active devices but, considering the NBD client
> reconnection is lazy, the handshake does not happen on idle ones which
> leads to a "Cannot grow NBD nodes" error when calling block_resize.
> 
> This patchset adds a function to manually trigger reconnection on an
> NBD device and calls it in the block_resize QMP command to make sure
> the new size gets exchanged before trying to update the device
> internals. It also implements the refresh callback in the raw and luks
> drivers, which forward it to their file child.

Before I even review this series, I wonder if it is time to consider
reviving discussion on the upstream NBD protocol mailing list about an
extension to allow NBD to optionally support resize messages.

If I recall the last time it was discussed several years ago, there
are competing needs: some scenarios want resize to be driven by the
server (for example, in response to a high-water write event done by
the client, the server detects that storage should grow; now the
server needs to advertise to the client that the exported volume is
larger); and some want it to be driven by the client (the client wants
to specifically ask the server for the export size to grow; the server
may or may not be able to comply).  NBD is normally client-driven, so
a client asking the server for a new size is easy to implement by
documenting a new NBD_CMD_RESIZE (in fact, opcode 8 is already
reserved for this in the NBD protocol document).

But the server being able to advertise a new size to the client is an
event-driven task, not client-driven.  Here, structured commands and
the fact that the protocol allows out-of-order responses appears to
provide a nice solution - the idea was that a new command initiated by
the client requests an open-ended registration of resize events, and
the server can reply with as many chunks as wanted over a long length
of time reusing the client's cookie, and not using the
NBD_REPLY_FLAG_DONE flag to end the stream of reply chunks until the
client deregisters from the request (either two new NBD_CMD to
register/deregister, or one command with a client flag to request
registration or deregistration).

Ultimately, having NBD able to support live resizes will be even nicer
than forcing client reconnections just to learn a new server size.
That said, your series probably still has merit, because even if we
extend the NBD protocol to allow live resize, it may take a while
before both client and server ends are upgraded to understand the new
protocol extension, while this reconnection should work with older
protocol.

> 
> Based-on: <20261105164124.249395-1-guillaume.vincke@ovhcloud.com>
> Needed to detect if the channel was closed by the server.
> 
> Based-on: <20261113140852.702959-1-guillaume.vincke@ovhcloud.com>
> Needed to implement a deterministic test.

Based on the dependencies, this is definitely qemu 12.0 material, not
11.2; but that shouldn't stop me from starting review now.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org



  parent reply	other threads:[~2026-11-19 16:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 14:46 [PATCH 0/5] block/nbd: Fix block resize on idle device Guillaume Vincke
2026-11-19 14:46 ` [PATCH 1/5] block/nbd: Extract request slot access and reconnection Guillaume Vincke
2026-11-19 22:16   ` Eric Blake
2026-11-19 14:46 ` [PATCH 2/5] block: Refresh the connection before block_resize Guillaume Vincke
2026-11-19 22:32   ` Eric Blake
2026-11-20 10:40     ` guillaume vincke
2026-11-19 14:46 ` [PATCH 3/5] block/nbd: Refresh the connection on block_resize Guillaume Vincke
2026-11-19 16:25   ` Eric Blake
2026-11-20 10:12     ` guillaume vincke
2026-11-19 14:46 ` [PATCH 4/5] iotests: Add coverage for NBD resize Guillaume Vincke
2026-11-19 22:51   ` Eric Blake
2026-11-20 10:17     ` guillaume vincke
2026-11-19 14:46 ` [PATCH 5/5] block: Add refresh connection support to raw and luks Guillaume Vincke
2026-11-19 16:20 ` Eric Blake [this message]
2026-11-20 10:04   ` [PATCH 0/5] block/nbd: Fix block resize on idle device guillaume vincke

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=av8d_ufYpxKMw4qk@redhat.com \
    --to=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=guillaume.vincke@ovhcloud.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=nbd@other.debian.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@yandex-team.ru \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.