From: Eric Blake <eblake@redhat.com>
To: guillaume vincke <guillaume.vincke@ovhcloud.com>
Cc: armbru@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org,
vsementsov@yandex-team.ru, kwolf@redhat.com, hreitz@redhat.com
Subject: Re: [PATCH 1/2] nbd: Add an unstable query for the client state
Date: Tue, 10 Nov 2026 09:51:45 -0600 [thread overview]
Message-ID: <avM8KkT30Eqol7PS@redhat.com> (raw)
In-Reply-To: <730c1463-8dfb-4040-9c61-330882320d7c@ovhcloud.com>
On Tue, Nov 10, 2026 at 04:07:35PM +0100, guillaume vincke wrote:
> On 11/10/26 13:53, Markus Armbruster wrote:
>
> Thanks for the review. Let me clarify before posting a v2.
>
> >
> > Why block-core.json and not block-export.json?
>
> If I get this right, block-export.json covers the server part. I
> thought adding this next to BlockdevOptionsNbd was a better fit. I can
> change that in v2 if you think block-export.json is a better match.
I'll trust Markus on this part of the review.
> > > +#
> > > +# @quit: Client will not reconnect.
> >
> > What does this one mean exactly?
>
> The client stopped for good. Requests fail and it never reconnects.
> This state is reached on fatal error or teardown.
So either the server gave up on the client (a protocol error such as
an incorrect magic number that means the server has lost sync and
prefers not to further entertain further input from the client), or
the client gracefully terminated (the NBD_OPT_ABORT during handshake
or NBD_CMD_DISC during normal operation for the client to tell the
server it is done). I don't know if we can tell those apart, nor if we
need to. For debugging purposes, merely knowing that the connection
is done (even if the fd is still in the process of being cleaned up)
is already good enough for most purposes.
>
> >
> > > +#
> > > +# Since: 11.2
> >
> > Making 11.2 seems unlikely.
>
> Sure. Would updating this to 12.0 make more sense ?
Agreed - this is too much on the "new feature" side to make soft
freeze; even if it only exists to make debugging easier and the iotest
that is now in 11.2 a bit more robust, I think aiming the new QMP
command for 12.0 is better.
> > > +#
> > > +# @state: The client state.
> > > +#
> > > +# @connector: The connector details. Only present while a connection
> > > +# attempt is running or its channel is parked.
> > > +#
> > > +# Since: 11.2
> > > +##
> > > +{ 'struct': 'XDbgNbdClient',
> > > + 'data': { 'state': 'XDbgNbdClientState',
> > > + '*connector': 'XDbgNbdClientConnector' } }
> >
> > How the combined state machine works is not clear to me. Is it
> > documented anywhere?
>
> I did not find a proper documentation. I found the comments on the code
> to be quite explicit though. The connector only runs in a connecting-*
> state. In that state, when processing a request, the client tries to
> get the channel from the connector. When the connector has a valid
> channel but the client did not request it, the connector is in parked
> state. Do you think this command should document that behavior?
>
> >
> > > +
> > > +##
> > > +# @x-debug-query-nbd-client:
> > > +# Get the NBD client state.
> > > +#
> > > +# @node-name: node name of the NBD client to query.
> >
> > How would I find the valid node names? query-block-exports?
>
> The node-name is listed by query-named-block-nodes or is the one passed
> to blockdev-add. I will add a reference to those commands in the
> docstring to clarify.
The export name need not match the node name (although it is common
for management apps to set the export name to copy the node name).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
next prev parent reply other threads:[~2026-11-10 15:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 16:06 [PATCH 0/2] nbd: Add an unstable query for the client state Guillaume Vincke
2026-11-09 16:06 ` [PATCH 1/2] " Guillaume Vincke
2026-11-10 12:53 ` Markus Armbruster
2026-11-10 15:07 ` guillaume vincke
2026-11-10 15:51 ` Eric Blake [this message]
2026-11-11 14:22 ` Markus Armbruster
2026-11-12 17:27 ` guillaume vincke
2026-11-09 16:06 ` [PATCH 2/2] iotests: Make nbd-stale-connection test deterministic Guillaume Vincke
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=avM8KkT30Eqol7PS@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 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.