[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v4 19/21] qemu-nbd: Add --list option

From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-block] [PATCH v4 19/21] qemu-nbd: Add --list option
Date: Fri, 18 Jan 2019 12:28:06 +0000

17.01.2019 22:36, Eric Blake wrote:
> We want to be able to detect whether a given qemu NBD server is
> exposing the right export(s) and dirty bitmaps, at least for
> regression testing.  We could use 'nbd-client -l' from the upstream
> NBD project to list exports, but it's annoying to rely on
> out-of-tree binaries; furthermore, nbd-client doesn't necessarily
> know about all of the qemu NBD extensions.  Thus, it is time to add
> a new mode to qemu-nbd that merely sniffs all possible information
> from the server during handshake phase, then disconnects and dumps
> the information.

[..] (hm, first time I do it for commit message)

> Not done here, but maybe worth future experiments: capture
> the meat of NBDExportInfo into a QAPI struct, and use the
> generated QAPI pretty-printers instead of hand-rolling our
> output loop.  It would also permit us to add a JSON output
> mode for machine parsing.
> Signed-off-by: Eric Blake <address@hidden>
> Reviewed-by: Richard W.M. Jones <address@hidden>

Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>

> @@ -816,6 +940,11 @@ int main(int argc, char **argv)
>           }
>       }
> +    if (list) {
> +        saddr = nbd_build_socket_address(sockpath, bindto, port);
> +        return qemu_nbd_client_list(saddr, tlscreds, bindto);

note, that this main() prefers to use exit() instead of return, even for last 
(but it has already one return, so this is not the first, and for me return 
looks better)

Best regards,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]