All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] nbd: Add an unstable query for the client state
@ 2026-11-30 11:13 Guillaume Vincke
  2026-11-30 11:13 ` [PATCH v3 1/2] " Guillaume Vincke
  2026-11-30 11:13 ` [PATCH v3 2/2] iotests: Add coverage for x-debug-query-nbd-client QMP command Guillaume Vincke
  0 siblings, 2 replies; 11+ messages in thread
From: Guillaume Vincke @ 2026-11-30 11:13 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

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.

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                           |  9 ++
 block/nbd.c                                   | 57 ++++++++++++
 nbd/client-connection.c                       | 22 +++++
 tests/qemu-iotests/tests/nbd-client-query     | 73 ++++++++++++++++
 tests/qemu-iotests/tests/nbd-client-query.out | 13 +++
 6 files changed, 261 insertions(+)
 create mode 100755 tests/qemu-iotests/tests/nbd-client-query
 create mode 100644 tests/qemu-iotests/tests/nbd-client-query.out

-- 
2.43.0



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

end of thread, other threads:[~2026-12-02  8:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 11:13 [PATCH v3 0/2] nbd: Add an unstable query for the client state Guillaume Vincke
2026-11-30 11:13 ` [PATCH v3 1/2] " Guillaume Vincke
2026-12-01 14:59   ` Eric Blake
2026-12-01 17:08     ` guillaume vincke
2026-12-01 17:26       ` Eric Blake
2026-12-02  8:37         ` Markus Armbruster
2026-11-30 11:13 ` [PATCH v3 2/2] iotests: Add coverage for x-debug-query-nbd-client QMP command Guillaume Vincke
2026-12-01 15:39   ` Eric Blake
2026-12-01 16:57     ` guillaume vincke
2026-12-01 17:28       ` Eric Blake
2026-12-01 16:32   ` 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.