On Wed, Sep 06, 2023 at 11:32:05AM +0200, Denis V. Lunev wrote: > We pass other parameters into nbd_client_thread() in this way. This patch > makes the code more consistent. > > Signed-off-by: Denis V. Lunev <d...@openvz.org> > CC: Eric Blake <ebl...@redhat.com> > CC: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru> > --- > qemu-nbd.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) >
> @@ -1059,19 +1060,19 @@ int main(int argc, char **argv) > bdrv_init(); > atexit(qemu_nbd_shutdown); > > - srcpath = argv[optind]; > + opts.srcpath = argv[optind]; > if (imageOpts) { > - QemuOpts *opts; > + QemuOpts *o; > if (fmt) { > error_report("--image-opts and -f are mutually exclusive"); > exit(EXIT_FAILURE); > } > - opts = qemu_opts_parse_noisily(&file_opts, srcpath, true); > - if (!opts) { > + o = qemu_opts_parse_noisily(&file_opts, opts.srcpath, true); > + if (!o) { Hmm - this would have been flagged by -Wshadow, and there are other series working to clean up tree-wide issues that shadowing can cause. Looking again, the shadowing was previously introduced before this series, but only when HAVE_NBD_DEVICE was defined; then patch 2/8 made the shadowing unconditional. Reworking the series to clean up the shadowing earlier in 2/8 is just churn, so I don't mind that it took us to this point to notice it; however, I'm inclined to add a note to the commit message that it is a (happy) side-effect. Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org