storage-daemon: report unexpected arguments on the fly
commita5ef35052e66721e9f943b2b9a91176536b4d896
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 1 Mar 2021 15:28:43 +0000 (1 10:28 -0500)
committerKevin Wolf <kwolf@redhat.com>
Mon, 8 Mar 2021 13:55:18 +0000 (8 14:55 +0100)
tree05db1adc17b7ad5b8c9d1f8df07bf485486815db
parent3b6ad6230e902168f63315e47933025b016f546e
storage-daemon: report unexpected arguments on the fly

If the first character of optstring is '-', then each nonoption argv
element is handled as if it were the argument of an option with character
code 1.  This removes the reordering of the argv array, and enables usage
of loc_set_cmdline to provide better error messages.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210301152844.291799-2-pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
storage-daemon/qemu-storage-daemon.c