Re: [Qemu-devel] Non-flat command line option argument syntax

2017-03-21 Thread Markus Armbruster
For the record, we went with "either dotted keys or JSON" for -blockdev in 2.9. Certain uses of QAPI become problematic with dotted keys, because (1) it's untyped except for inner tree nodes, and therefore can't express numbers, boolean, null, empty list, empty object, and (2) The keyval variant

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-03-01 Thread Markus Armbruster
Markus Armbruster writes: [...] > == Extensions of the traditional syntax == > > Even if we accept JSON in addition to the traditional KEY=VALUE,... > syntax, we might want to make the traditional syntax more expressive > anyway. Do we? > > Kevin brought up an argument for yes: without it, going

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-28 Thread Markus Armbruster
Eric Blake writes: > On 02/27/2017 04:27 AM, Markus Armbruster wrote: >> Design flaw: there is no good way to denote an empty array or object >> other than the root object. >> >> Empty KEY=VALUE,... is valid and results in an empty root object. >> >> Presence of a KEY that contains periods resu

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-28 Thread Markus Armbruster
Eric Blake writes: > On 02/27/2017 07:36 AM, Markus Armbruster wrote: > >> >>> Maybe just 'foo.array[]' (without any =) for an empty >>> array or something like that. >> >> Yes, that should do. Likewise foo.object{} for empty object. >> >> {} doesn't even need quoting. [] ma

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-27 Thread Eric Blake
On 02/27/2017 04:27 AM, Markus Armbruster wrote: > Design flaw: there is no good way to denote an empty array or object > other than the root object. > > Empty KEY=VALUE,... is valid and results in an empty root object. > > Presence of a KEY that contains periods results in additional non-root >

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-27 Thread Eric Blake
On 02/27/2017 07:36 AM, Markus Armbruster wrote: > >> Maybe just 'foo.array[]' (without any =) for an empty >> array or something like that. > > Yes, that should do. Likewise foo.object{} for empty object. > > {} doesn't even need quoting. [] may. [contents] needs quoting, b

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-27 Thread Markus Armbruster
Kevin Wolf writes: > Am 27.02.2017 um 11:27 hat Markus Armbruster geschrieben: >> Markus Armbruster writes: >> >> [...] >> > === Dotted keys === >> > >> > One sufficiently powerful syntax extension already exists: the dotted >> > key convention. It's syntactically unambiguous only when none of

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-27 Thread Kevin Wolf
Am 27.02.2017 um 11:27 hat Markus Armbruster geschrieben: > Markus Armbruster writes: > > [...] > > === Dotted keys === > > > > One sufficiently powerful syntax extension already exists: the dotted > > key convention. It's syntactically unambiguous only when none of the > > KEYs involved contain

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-27 Thread Markus Armbruster
Markus Armbruster writes: [...] > === Dotted keys === > > One sufficiently powerful syntax extension already exists: the dotted > key convention. It's syntactically unambiguous only when none of the > KEYs involved contains '.' To adopt it across the board, we'd have to > outlaw '.' in KEYs. Q

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-24 Thread Markus Armbruster
Eric Blake writes: > On 02/24/2017 10:39 AM, Daniel P. Berrange wrote: >> On Fri, Feb 24, 2017 at 05:04:34PM +0100, Markus Armbruster wrote: >>> Markus Armbruster writes: >>> >>> [...] === Dotted keys === One sufficiently powerful syntax extension already exists: the dotted k

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-24 Thread Eric Blake
On 02/24/2017 10:39 AM, Daniel P. Berrange wrote: > On Fri, Feb 24, 2017 at 05:04:34PM +0100, Markus Armbruster wrote: >> Markus Armbruster writes: >> >> [...] >>> === Dotted keys === >>> >>> One sufficiently powerful syntax extension already exists: the dotted >>> key convention. It's syntactica

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-24 Thread Daniel P. Berrange
On Fri, Feb 24, 2017 at 05:04:34PM +0100, Markus Armbruster wrote: > Markus Armbruster writes: > > [...] > > === Dotted keys === > > > > One sufficiently powerful syntax extension already exists: the dotted > > key convention. It's syntactically unambiguous only when none of the > > KEYs involve

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-24 Thread Markus Armbruster
Markus Armbruster writes: [...] > === Dotted keys === > > One sufficiently powerful syntax extension already exists: the dotted > key convention. It's syntactically unambiguous only when none of the > KEYs involved contains '.' To adopt it across the board, we'd have to > outlaw '.' in KEYs. Q

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-07 Thread Kevin Wolf
Am 06.02.2017 um 16:36 hat Markus Armbruster geschrieben: > >> === Structured values === > >> > >> The dotted key convention messes with KEY syntax to permit structured > >> values. Works, but the more conventional way to support structured > >> values is a syntax for structured values. > >> >

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-06 Thread Markus Armbruster
Paolo Bonzini writes: > On 06/02/2017 19:12, Markus Armbruster wrote: >>> QOM now supports class properties. We can convert the wide majority of >>> them, including qdev's "static" properties, to class properties. >> >> Won't help object-add as long as dynamic properties remain. > > Well, only

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-06 Thread Paolo Bonzini
On 06/02/2017 19:12, Markus Armbruster wrote: >> QOM now supports class properties. We can convert the wide majority of >> them, including qdev's "static" properties, to class properties. > > Won't help object-add as long as dynamic properties remain. Well, only as long as dynamic properties r

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-06 Thread Markus Armbruster
Note: a bit more context restored. "Daniel P. Berrange" writes: > On Mon, Feb 06, 2017 at 06:24:42PM +0100, Markus Armbruster wrote: >> "Daniel P. Berrange" writes: >> >> > On Mon, Feb 06, 2017 at 04:36:50PM +0100, Markus Armbruster wrote: >> >> Kevin Wolf writes: >> >> >> >> > Am 02.02.2017

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-06 Thread Markus Armbruster
Paolo Bonzini writes: > On 06/02/2017 16:36, Markus Armbruster wrote: >> Example: QOM properties and object-add, qom-set, qom-get >> >> QOM properties are created at run-time. They cannot be fixed at >> compile-time *by design*. I always hated that part of the design, but I >> was assured we a

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-06 Thread Daniel P. Berrange
On Mon, Feb 06, 2017 at 06:24:42PM +0100, Markus Armbruster wrote: > "Daniel P. Berrange" writes: > > > On Mon, Feb 06, 2017 at 04:36:50PM +0100, Markus Armbruster wrote: > >> Kevin Wolf writes: > >> > Want to make use of the shiny new QemuOpts and get things parsed into > >> > a nested object?

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-06 Thread Paolo Bonzini
On 06/02/2017 16:36, Markus Armbruster wrote: > Example: QOM properties and object-add, qom-set, qom-get > > QOM properties are created at run-time. They cannot be fixed at > compile-time *by design*. I always hated that part of the design, but I > was assured we absolutely need that much rope

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-06 Thread Markus Armbruster
"Daniel P. Berrange" writes: > On Mon, Feb 06, 2017 at 04:36:50PM +0100, Markus Armbruster wrote: >> Kevin Wolf writes: >> > Want to make use of the shiny new QemuOpts and get things parsed into >> > a nested object? Well, provide a real schema instead of "any" then. >> >> Sadly, this is somewh

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-06 Thread Daniel P. Berrange
On Mon, Feb 06, 2017 at 04:36:50PM +0100, Markus Armbruster wrote: > Kevin Wolf writes: > > Want to make use of the shiny new QemuOpts and get things parsed into > > a nested object? Well, provide a real schema instead of "any" then. > > Sadly, this is somewhere between impractical and impossible

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-06 Thread Markus Armbruster
Kevin Wolf writes: > Am 02.02.2017 um 20:42 hat Markus Armbruster geschrieben: >> = Brief recap of dotted key convention = >> >> We'll discuss use of dotted key convention later, so let me explain it >> briefly for the readers who don't know it already. >> >> The dotted key convention interpret

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-06 Thread Kevin Wolf
Am 02.02.2017 um 20:42 hat Markus Armbruster geschrieben: > = Brief recap of dotted key convention = > > We'll discuss use of dotted key convention later, so let me explain it > briefly for the readers who don't know it already. > > The dotted key convention interprets the KEY part as a sequence

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-06 Thread Daniel P. Berrange
On Sat, Feb 04, 2017 at 08:21:50PM +0800, Fam Zheng wrote: > On Thu, 02/02 20:42, Markus Armbruster wrote: > > === Comparison === > > > > In my opinion, dotted keys are weird and ugly, but at least they don't > > add to the quoting mess. Structured values look better, except when > > they do add

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-06 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > "Dr. David Alan Gilbert" writes: > > > * Markus Armbruster (arm...@redhat.com) wrote: > >> "Dr. David Alan Gilbert" writes: > >> > >> > * Markus Armbruster (arm...@redhat.com) wrote: > [...] > >> >> === Structured values === > >> >> > >> >> The

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-05 Thread Markus Armbruster
Markus Armbruster writes: [...] > === Structured values === > > The dotted key convention messes with KEY syntax to permit structured > values. Works, but the more conventional way to support structured > values is a syntax for structured values. > > An obvious one is to use { KEY=VALUE, ...}

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-05 Thread Markus Armbruster
Fam Zheng writes: > On Sat, 02/04 14:35, Markus Armbruster wrote: >> Fam Zheng writes: >> >> > On Thu, 02/02 20:42, Markus Armbruster wrote: >> >> === Comparison === >> >> >> >> In my opinion, dotted keys are weird and ugly, but at least they don't >> >> add to the quoting mess. Structured va

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-04 Thread Fam Zheng
On Sat, 02/04 14:35, Markus Armbruster wrote: > Fam Zheng writes: > > > On Thu, 02/02 20:42, Markus Armbruster wrote: > >> === Comparison === > >> > >> In my opinion, dotted keys are weird and ugly, but at least they don't > >> add to the quoting mess. Structured values look better, except when

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-04 Thread Markus Armbruster
Fam Zheng writes: > On Thu, 02/02 20:42, Markus Armbruster wrote: >> === Comparison === >> >> In my opinion, dotted keys are weird and ugly, but at least they don't >> add to the quoting mess. Structured values look better, except when >> they do add to the quoting mess. >> >> I'm having a har

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-04 Thread Fam Zheng
On Sat, 02/04 04:44, Paolo Bonzini wrote: > > > On 04/02/2017 04:21, Fam Zheng wrote: > > -json "id=children0,text=[ > > { 'driver': 'null-co://' }, > > { 'driver': 'null-co://' }, > > You meant ,, at the end of this lines. Which throws a wrench in your > pro

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-04 Thread Paolo Bonzini
On 04/02/2017 04:21, Fam Zheng wrote: > -json "id=children0,text=[ > { 'driver': 'null-co://' }, > { 'driver': 'null-co://' }, You meant ,, at the end of this lines. Which throws a wrench in your proposal somewhat. :( Paolo > { 'driver': 'nu

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-04 Thread Paolo Bonzini
On 04/02/2017 03:52, Markus Armbruster wrote: > Paolo Bonzini writes: > >> On 04/02/2017 01:45, Markus Armbruster wrote: > -drive driver=qcow2, > file.driver=gluster, > .volume=testvol, > .path=/path/a.qcow2, >

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-04 Thread Fam Zheng
On Thu, 02/02 20:42, Markus Armbruster wrote: > === Comparison === > > In my opinion, dotted keys are weird and ugly, but at least they don't > add to the quoting mess. Structured values look better, except when > they do add to the quoting mess. > > I'm having a hard time deciding which one I l

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-04 Thread Markus Armbruster
Paolo Bonzini writes: > On 04/02/2017 01:45, Markus Armbruster wrote: -drive driver=qcow2, file.driver=gluster, .volume=testvol, .path=/path/a.qcow2, .debug=9, file.server.0.type=tcp,

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-04 Thread Paolo Bonzini
On 04/02/2017 01:45, Markus Armbruster wrote: >>> -drive driver=qcow2, >>> file.driver=gluster, >>> .volume=testvol, >>> .path=/path/a.qcow2, >>> .debug=9, >>> file.server.0.type=tcp, >>> .host=1

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-04 Thread Markus Armbruster
"Richard W.M. Jones" writes: > On Thu, Feb 02, 2017 at 08:42:33PM +0100, Markus Armbruster wrote: >> There's also the -drive file=json:... syntax. It's a bad fit for >> QemuOpts, because QemuOpts and JSON fight for the comma. I'd show you >> if I could get it to work. > > I think this refers to

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-04 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> "Dr. David Alan Gilbert" writes: >> >> > * Markus Armbruster (arm...@redhat.com) wrote: [...] >> >> === Structured values === >> >> >> >> The dotted key convention messes with KEY syntax to permit structured >

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-03 Thread Richard W.M. Jones
On Thu, Feb 02, 2017 at 08:42:33PM +0100, Markus Armbruster wrote: > There's also the -drive file=json:... syntax. It's a bad fit for > QemuOpts, because QemuOpts and JSON fight for the comma. I'd show you > if I could get it to work. I think this refers to the json: syntax for qemu URIs? Anywa

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-03 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > "Dr. David Alan Gilbert" writes: > > > * Markus Armbruster (arm...@redhat.com) wrote: > >> = Introduction = > >> > > > > > > > >> = Structured option argument syntax = > >> > >> == JSON == > >> > >> The obvious way to provide the expressiveness

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-03 Thread Markus Armbruster
Peter Krempa writes: > On Thu, Feb 02, 2017 at 20:42:33 +0100, Markus Armbruster wrote: > > [...] > >> === Comparison === >> >> In my opinion, dotted keys are weird and ugly, but at least they don't >> add to the quoting mess. Structured values look better, except when >> they do add to the quo

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-03 Thread Peter Krempa
On Thu, Feb 02, 2017 at 20:42:33 +0100, Markus Armbruster wrote: [...] > === Comparison === > > In my opinion, dotted keys are weird and ugly, but at least they don't > add to the quoting mess. Structured values look better, except when > they do add to the quoting mess. From libvirt's point o

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-03 Thread Markus Armbruster
"Daniel P. Berrange" writes: > On Thu, Feb 02, 2017 at 08:42:33PM +0100, Markus Armbruster wrote: >> === Dotted keys === >> >> One sufficiently powerful syntax extension already exists: the dotted >> key convention. It's syntactically unambiguous only when none of the >> KEYs involved contains

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-03 Thread Daniel P. Berrange
On Thu, Feb 02, 2017 at 08:42:33PM +0100, Markus Armbruster wrote: > === Dotted keys === > > One sufficiently powerful syntax extension already exists: the dotted > key convention. It's syntactically unambiguous only when none of the > KEYs involved contains '.' To adopt it across the board, we'

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-02 Thread Markus Armbruster
Eric Blake writes: > On 02/02/2017 01:42 PM, Markus Armbruster wrote: > >> >> === Structured values === >> >> The dotted key convention messes with KEY syntax to permit structured >> values. Works, but the more conventional way to support structured >> values is a syntax for structured values.

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-02 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> = Introduction = >> > > > >> = Structured option argument syntax = >> >> == JSON == >> >> The obvious way to provide the expressiveness of JSON on the command >> line is JSON. Easy enough[2]. However, besid

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-02 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > = Introduction = > > = Structured option argument syntax = > > == JSON == > > The obvious way to provide the expressiveness of JSON on the command > line is JSON. Easy enough[2]. However, besides not being compatible, > it's rather heavy on s

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-02 Thread Eric Blake
On 02/02/2017 01:42 PM, Markus Armbruster wrote: > > === Structured values === > > The dotted key convention messes with KEY syntax to permit structured > values. Works, but the more conventional way to support structured > values is a syntax for structured values. > > An obvious one is to u

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-02 Thread Eric Blake
On 02/02/2017 01:42 PM, Markus Armbruster wrote: quick comment before I reply to the overall message... > Arbitrary nesting with dotted key convention: > > -drive driver=qcow2,file.driver=gluster, >file.volume=testvol,file.path=/path/a.qcow2,file.debug=9, >file.serve

[Qemu-devel] Non-flat command line option argument syntax

2017-02-02 Thread Markus Armbruster
= Introduction = If you're familiar with prior discussion of non-flat arguments for -object and -blockdev, you can probably skip ahead to "= Structured option argument syntax =". Structured option arguments use KEY=VALUE,... syntax. Goes back many years (at least to commit 7c9d8e0, Nov 2005). S