All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] nbd: Add an unstable query for the client state
@ 2026-12-03 12:20 Guillaume Vincke
  2026-12-03 12:20 ` [PATCH v4 1/2] " Guillaume Vincke
  2026-12-03 12:20 ` [PATCH v4 2/2] iotests: Add coverage for x-debug-query-nbd-client QMP command Guillaume Vincke
  0 siblings, 2 replies; 6+ messages in thread
From: Guillaume Vincke @ 2026-12-03 12:20 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-block, Eric Blake, Vladimir Sementsov-Ogievskiy, Kevin Wolf,
	Hanna Reitz, Markus Armbruster, Guillaume Vincke

These changes follow the discussion on:
https://patchew.org/QEMU/20261105164124.249395-1-guillaume.vincke@ovhcloud.com/#au4tsMuhKjq62dVB@redhat.com
Even though Eric Blake suggested a query for NBD server state,
considering the nbd-stale-connection test we are trying to make
deterministic relies on qemu-nbd, which does not have QMP, this
patchset adds a command to query the NBD client state.

The created QMP command output lists the client internals. The
connector field is used to give the NBD client connection thread
details, i.e. when idle, running or when a channel is ready to be
picked up. Other fields such as in-flight or negotiated size can easily
be added at the top level while others like the connector's last error
would be added into the connector one.

Considering this command accesses the client's private state, it is
implemented in block/nbd.c where BDRVNBDState is defined.

v1: https://patchew.org/QEMU/20261109160609.1434289-1-guillaume.vincke@ovhcloud.com
v2: https://patchew.org/QEMU/20261113140852.702959-1-guillaume.vincke@ovhcloud.com
v3: https://patchew.org/QEMU/20261130111327.178850-1-guillaume.vincke@ovhcloud.com

v1 -> v2:
- patch 1: Connector is now always present, with an idle state. Read
  client and connector states under the same lock. Add the NBD state
  information to the QMP documentation. Fix documentation wording and
  version number.
- patch 2: Simplify the connector lookup using the new QMP command
  output.

v2 -> v3:
- Break dependency on <20261105164124.249395-1-guillaume.vincke@ovhcloud.com>
- patch 1: Add Markus Armbruster's Acked-by
- patch 2: Replace the integration into an existing test with a new one
  covering the command capabilities. nbd-stale-connection changes move
  to its own v4 patchset.

v3 -> v4:
- patch 1: Drop the XDbg prefix from enum types and use them
  internally. Kept Markus's Acked-by as he validated the change.
- patch 2: Yank the node to move the client into the "quit" state.

Guillaume Vincke (2):
  nbd: Add an unstable query for the client state
  iotests: Add coverage for x-debug-query-nbd-client QMP command

 qapi/block-core.json                          | 87 +++++++++++++++++++
 include/block/nbd.h                           |  4 +
 block/nbd.c                                   | 84 +++++++++++-------
 nbd/client-connection.c                       | 22 +++++
 tests/qemu-iotests/tests/nbd-client-query     | 78 +++++++++++++++++
 tests/qemu-iotests/tests/nbd-client-query.out | 15 ++++
 6 files changed, 261 insertions(+), 29 deletions(-)
 create mode 100755 tests/qemu-iotests/tests/nbd-client-query
 create mode 100644 tests/qemu-iotests/tests/nbd-client-query.out


base-commit: fbb87b0d358a3e8ab11d59bcdf80ac34c97f6e3e
-- 
2.43.0



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

end of thread, other threads:[~2026-12-04  9:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 12:20 [PATCH v4 0/2] nbd: Add an unstable query for the client state Guillaume Vincke
2026-12-03 12:20 ` [PATCH v4 1/2] " Guillaume Vincke
2026-12-03 18:41   ` Eric Blake
2026-12-04  9:40     ` Markus Armbruster
2026-12-03 12:20 ` [PATCH v4 2/2] iotests: Add coverage for x-debug-query-nbd-client QMP command Guillaume Vincke
2026-12-03 18:42   ` Eric Blake

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.