[virt-tools-list] virt-install: Add warn if 'single-use' options are defined multiple times?

Cole Robinson crobinso at redhat.com
Mon Oct 1 17:16:34 UTC 2018


On 09/14/2018 04:28 PM, Mark Kanda wrote:
> Hi all,
> 
> I recently discovered, for 'single-use' command line options, 
> virt-install silently ignores all but the last definition. For example, 
> if the command line has '--memory X' and later '--memory Y', then 'X' is 
> silently ignored.
> 
> I think virt-install should warn the user if 'single use' options are 
> specified multiple times, and I'd like to implement a fix.
> 
> However, before I implement such a fix, I'd like to know if this is 'by 
> design', or if anyone would otherwise object to such a check..
> 

Sorry for the late response. This isn't really intentional and more just 
a side effect of how our argparse options are initialized. I hacked up 
the attached diff that will essentially merge all ex. --memory options,
so --memory 123,maxmem=456 --memory 555 will be equivalent to --memory 
555,maxmem=456. Is that fine for you needs?

I think it's a bit nicer and has benefits if you want to pass in an 
extra option to a virt-install script or similar

Thanks,
Cole
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-cli-Merge-multiple-instances-of-single-use-opts.patch
Type: text/x-patch
Size: 6852 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20181001/0e7f5a52/attachment.bin>


More information about the virt-tools-list mailing list