Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Paolo Bonzini
Il mar 16 feb 2021, 15:52 Peter Maydell ha scritto: > > It's just an example that the prevalence of "nowait" over "wait" is > simply because the default of "server" is false while the default of "wait" > is true. Any boolean option whose default is true could benefit from a > "no"-prefixed short

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Peter Maydell
On Tue, 16 Feb 2021 at 14:45, Paolo Bonzini wrote: > > Il mar 16 feb 2021, 15:11 Peter Maydell ha scritto: >> >> On Tue, 16 Feb 2021 at 13:44, Paolo Bonzini wrote: >> > >> > On 16/02/21 14:36, Peter Maydell wrote: >> > > Broadly, I think that being able to say 'foo' when foo is a >> > > boolean

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Paolo Bonzini
Il mar 16 feb 2021, 15:11 Peter Maydell ha scritto: > On Tue, 16 Feb 2021 at 13:44, Paolo Bonzini wrote: > > > > On 16/02/21 14:36, Peter Maydell wrote: > > > Broadly, I think that being able to say 'foo' when foo is a > > > boolean option being set to true is obvious and nice-to-use > > > synta

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Peter Maydell
On Tue, 16 Feb 2021 at 13:44, Paolo Bonzini wrote: > > On 16/02/21 14:36, Peter Maydell wrote: > > Broadly, I think that being able to say 'foo' when foo is a > > boolean option being set to true is obvious and nice-to-use > > syntax, and I don't really want it to go away. 'nofoo' for > > 'foo=fal

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Daniel P . Berrangé
On Tue, Feb 16, 2021 at 01:36:46PM +, Peter Maydell wrote: > On Tue, 16 Feb 2021 at 13:30, Paolo Bonzini wrote: > > On 16/02/21 12:58, Peter Maydell wrote: > > > On Tue, 16 Feb 2021 at 11:23, Paolo Bonzini wrote: > > >> I agree, and that's why I have no plans to move -chardev off QemuOpts; >

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Paolo Bonzini
On 16/02/21 14:36, Peter Maydell wrote: My first submission of this patch even special cased "-chardev" to hide the warning, but this was dropped in response to reviews. (https://patchew.org/QEMU/20201103151452.416784-1-pbonz...@redhat.com/20201103151452.416784-5-pbonz...@redhat.com/). I can a

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Peter Maydell
On Tue, 16 Feb 2021 at 13:30, Paolo Bonzini wrote: > On 16/02/21 12:58, Peter Maydell wrote: > > On Tue, 16 Feb 2021 at 11:23, Paolo Bonzini wrote: > >> I agree, and that's why I have no plans to move -chardev off QemuOpts; > >> warning is a different step than excising and sometimes years pass f

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Paolo Bonzini
On 16/02/21 12:58, Peter Maydell wrote: On Tue, 16 Feb 2021 at 11:23, Paolo Bonzini wrote: I agree, and that's why I have no plans to move -chardev off QemuOpts; warning is a different step than excising and sometimes years pass from one to the other. However, that doesn't prevent introducing

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Peter Maydell
On Tue, 16 Feb 2021 at 11:23, Paolo Bonzini wrote: > I agree, and that's why I have no plans to move -chardev off QemuOpts; > warning is a different step than excising and sometimes years pass from > one to the other. However, that doesn't prevent introducing a warning > so that users slowly move

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Paolo Bonzini
On 16/02/21 12:04, Peter Maydell wrote: On Tue, 16 Feb 2021 at 10:43, Paolo Bonzini wrote: For this to work, one would need to have a typed string->QAPI parser, i.e. one that takes the schema as input rather than doing a generic parsing to QDict and then using the schema via the visitor. That

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Peter Maydell
On Tue, 16 Feb 2021 at 10:43, Paolo Bonzini wrote: > For this to work, one would need to have a typed string->QAPI parser, > i.e. one that takes the schema as input rather than doing a generic > parsing to QDict and then using the schema via the visitor. That would > IMHO be overengineered for th

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Paolo Bonzini
On 16/02/21 10:58, Peter Maydell wrote: Unfortunately there is no way to change the code to distinguish okay uses from broken ones. The fundamental issue is that QemuOpts is sometimes typed and sometimes not, so it lacks the information to say that "-chardev socket,server" is fine but "-device vi

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-16 Thread Peter Maydell
On Mon, 15 Feb 2021 at 23:15, Paolo Bonzini wrote: > > Il lun 15 feb 2021, 20:56 Peter Maydell ha scritto: >> >> Alternatively, maybe we could not deprecate this really common syntax >> pattern that's going to be in lots of peoples' examples, tutorials, >> shell scripts and command lines ? > > >

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-15 Thread Paolo Bonzini
Il lun 15 feb 2021, 20:56 Peter Maydell ha scritto: > Alternatively, maybe we could not deprecate this really common syntax > pattern that's going to be in lots of peoples' examples, tutorials, > shell scripts and command lines ? > Unfortunately there is no way to change the code to distinguish

Re: [PULL 31/31] qemu-option: warn for short-form boolean options

2021-02-15 Thread Peter Maydell
On Sat, 23 Jan 2021 at 14:50, Paolo Bonzini wrote: > Options such as "server" or "nowait", that are commonly found in -chardev, > are sugar for "server=on" and "wait=off". This is quite surprising and > also does not have any notion of typing attached. It is even possible to > do "-device e1000,

[PULL 31/31] qemu-option: warn for short-form boolean options

2021-01-23 Thread Paolo Bonzini
Options such as "server" or "nowait", that are commonly found in -chardev, are sugar for "server=on" and "wait=off". This is quite surprising and also does not have any notion of typing attached. It is even possible to do "-device e1000,noid" and get a device with "id=off". Deprecate it and prin