qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] storage-daemon: include current command line option in the errors
@ 2021-03-01 15:28 Paolo Bonzini
  2021-03-01 15:28 ` [PATCH v2 1/2] storage-daemon: report unexpected arguments on the fly Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Paolo Bonzini @ 2021-03-01 15:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, qemu-block

Use the location management facilities that the emulator uses, so that
the current command line option appears in the error message.

Before:

  $ storage-daemon/qemu-storage-daemon --nbd key..=
  qemu-storage-daemon: Invalid parameter 'key..'

After:

  $ storage-daemon/qemu-storage-daemon --nbd key..=
  qemu-storage-daemon: --nbd key..=: Invalid parameter 'key..'

The first patch tweaks the command line parsing so that argv is
not reordered by getopt_long and optind is only advanced by one
option+argument on every call to getopt_long.  This is required
by loc_set_cmdline.

Paolo Bonzini (2):
  storage-daemon: report unexpected arguments on the fly
  storage-daemon: include current command line option in the errors

 storage-daemon/qemu-storage-daemon.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

-- 
2.26.2



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-02  6:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-01 15:28 [PATCH v2 0/2] storage-daemon: include current command line option in the errors Paolo Bonzini
2021-03-01 15:28 ` [PATCH v2 1/2] storage-daemon: report unexpected arguments on the fly Paolo Bonzini
2021-03-01 15:38   ` Eric Blake
2021-03-01 16:29     ` Paolo Bonzini
2021-03-02  6:33     ` Markus Armbruster
2021-03-01 15:28 ` [PATCH v2 2/2] storage-daemon: include current command line option in the errors Paolo Bonzini
2021-03-02  6:38   ` Markus Armbruster
2021-03-01 18:24 ` [PATCH v2 0/2] " Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).