QEMU-Devel Archive on 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,
	 Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
	 Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH v4 1/2] nbd: Add an unstable query for the client state
Date: Thu, 3 Dec 2026 12:41:10 -0600	[thread overview]
Message-ID: <axG0_mTXRxdrQdtc@redhat.com> (raw)
In-Reply-To: <20261203122055.134148-2-guillaume.vincke@ovhcloud.com>

On Thu, Dec 03, 2026 at 01:20:54PM +0100, Guillaume Vincke wrote:
> At the moment, NBD client internals cannot be accessed. Therefore,
> tests have to infer the client state from I/O results and wait with
> sleeps, which is racy.
> 
> Add the x-debug-query-nbd-client QMP command that reports the state of
> the client's connection and of its connector. Other fields will be
> added when needed.
> 
> Signed-off-by: Guillaume Vincke <guillaume.vincke@ovhcloud.com>
> Acked-by: Markus Armbruster <armbru@redhat.com>
> ---
>  qapi/block-core.json    | 87 +++++++++++++++++++++++++++++++++++++++++
>  include/block/nbd.h     |  4 ++
>  block/nbd.c             | 84 +++++++++++++++++++++++++--------------
>  nbd/client-connection.c | 22 +++++++++++
>  4 files changed, 168 insertions(+), 29 deletions(-)
> 

> @@ -74,7 +69,7 @@ typedef struct BDRVNBDState {
>       * reconnect_delay_timer.
>       */
>      QemuMutex requests_lock;
> -    NBDClientState state;
> +    NbdClientState state;

Side effect of the QAPI enum naming rules. NBD is an acronym (Network
Block Device) so I favor the all-caps where it is easy, but I'm not
too fussed to see the mixed-case version. I don't know off-hand if the
QAPI generator has a magic knob for listing well-known acronyms that
should remain uppercase even when converting the rest of a name to the
expected conventions of its usage (a quick 'git grep -i acronym
scripts/qapi' had no hits); but I also see no reason why we would need
to implement one just to prevent this change in case.

Reviewed-by: Eric Blake <eblake@redhat.com>

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



  reply	other threads:[~2026-12-03 18:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=axG0_mTXRxdrQdtc@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=guillaume.vincke@ovhcloud.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox