All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] block/nbd: Fix block resize on idle device
@ 2026-11-19 14:46 Guillaume Vincke
  2026-11-19 14:46 ` [PATCH 1/5] block/nbd: Extract request slot access and reconnection Guillaume Vincke
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Guillaume Vincke @ 2026-11-19 14:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-block, eblake, vsementsov, kwolf, hreitz, stefanha, fam,
	Guillaume Vincke

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.

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.

Guillaume Vincke (5):
  block/nbd: Extract request slot access and reconnection
  block: Refresh the connection before block_resize
  block/nbd: Refresh the connection on block_resize
  iotests: Add coverage for NBD resize
  block: Add refresh connection support to raw and luks

 block/block-backend.c                   |  12 +++
 block/crypto.c                          |   7 ++
 block/io.c                              |  24 +++++
 block/nbd.c                             |  95 +++++++++++++++----
 block/raw-format.c                      |   7 ++
 blockdev.c                              |   9 ++
 include/block/block-io.h                |   8 ++
 include/block/block_int-common.h        |   3 +
 include/block/nbd.h                     |   1 +
 include/system/block-backend-io.h       |   2 +
 nbd/client-connection.c                 |   7 +-
 tests/qemu-iotests/tests/nbd-resize     | 116 ++++++++++++++++++++++++
 tests/qemu-iotests/tests/nbd-resize.out |  24 +++++
 13 files changed, 297 insertions(+), 18 deletions(-)
 create mode 100755 tests/qemu-iotests/tests/nbd-resize
 create mode 100644 tests/qemu-iotests/tests/nbd-resize.out


base-commit: 6883fb508cb7a93e2e7b44c0582bfd9fc2196d4d
prerequisite-patch-id: 484bee7f7d30179f284198c8fc5162830f56b2e2
prerequisite-patch-id: 73f560b55444e04d1615f3351b13a47f375bcd82
prerequisite-patch-id: 722470bc9ae187fc429d7af8a5f3eefb46bf80d7
prerequisite-patch-id: 6c1f8d46edf0e6dc070764a755d34740855af4f1
-- 
2.43.0



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-11-20 10:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 0/5] block/nbd: Fix block resize on idle device Eric Blake
2026-11-20 10:04   ` guillaume vincke

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.