qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] storage-daemon: include current command line option in the e


From: Paolo Bonzini
Subject: Re: [PATCH] storage-daemon: include current command line option in the errors
Date: Mon, 1 Mar 2021 16:09:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

On 01/03/21 13:26, Kevin Wolf wrote:
This save_index approach isn't perfect because getopt may skip
non-option arguments and they will be included in the help text:

     $ build/storage-daemon/qemu-storage-daemon foo --object iothread
     qemu-storage-daemon: foo --object iothread: Parameter 'id' is missing

     $ build/storage-daemon/qemu-storage-daemon foo --object iothread,id=t
     qemu-storage-daemon: --object iothread,id=t foo: Unexpected argument: foo

However, without changing the interface of loc_set_cmdline(), getting
the right index seems hard. Not sure what is the best way for fixing
this or if it's worth the effort.

We can do better by passing "-hT:V" to getopt_long. Then each non-option argument is returned directly, and everything works as getopt_long no longer needs to reorder argv.

Paolo




reply via email to

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