[PATCH 0/2] nbd: Add an unstable query for the client state

Guillaume Vincke posted 2 patches 3 days, 9 hours ago
block/nbd.c                                   | 57 +++++++++++++
include/block/nbd.h                           |  9 +++
nbd/client-connection.c                       | 18 +++++
qapi/block-core.json                          | 79 +++++++++++++++++++
tests/qemu-iotests/tests/nbd-stale-connection | 17 ++--
5 files changed, 175 insertions(+), 5 deletions(-)
[PATCH 0/2] nbd: Add an unstable query for the client state
Posted by Guillaume Vincke 3 days, 9 hours ago
Based-on: <20261105164124.249395-1-guillaume.vincke@ovhcloud.com>

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 optional
connector field is used to give the NBD client connection thread
details only when relevant, i.e. when 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.

Guillaume Vincke (2):
  nbd: Add an unstable query for the client state
  iotests: Make nbd-stale-connection test deterministic

 block/nbd.c                                   | 57 +++++++++++++
 include/block/nbd.h                           |  9 +++
 nbd/client-connection.c                       | 18 +++++
 qapi/block-core.json                          | 79 +++++++++++++++++++
 tests/qemu-iotests/tests/nbd-stale-connection | 17 ++--
 5 files changed, 175 insertions(+), 5 deletions(-)

-- 
2.43.0