All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Kővágó Zoltán" <dirty.ice.hu@gmail.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	qemu-devel@nongnu.org, "László Ersek" <lersek@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Michael Roth" <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/6] qapi: support nested structs in OptsVisitor
Date: Wed, 17 Jun 2015 16:02:00 +0200	[thread overview]
Message-ID: <55817DD8.6060605@gmail.com> (raw)
In-Reply-To: <87bnge310y.fsf@blackfin.pond.sub.org>

2015-06-17 15:41 keltezéssel, Markus Armbruster írta:
> "Kővágó Zoltán" <dirty.ice.hu@gmail.com> writes:
>
>> 2015-06-17 13:18 keltezéssel, Markus Armbruster írta:
>>> Copying Kevin because similar issues exist in the block layer.
>>>
>>> Gerd Hoffmann <kraxel@redhat.com> writes:
>>>
>>>> On Mi, 2015-06-17 at 09:50 +0200, Markus Armbruster wrote:
>>>>> Copying László because his fingerprints are on OptsVisitor.
>>>>>
>>>>> "Kővágó, Zoltán" <dirty.ice.hu@gmail.com> writes:
>>>>>
>>>>>> The current OptsVisitor flattens the whole structure, if there are
>>>>>> same named
>>>>>> fields under different paths (like `in' and `out' in `Audiodev'),
>>>>>> the current
>>>>>> visitor can't cope with them (for example setting
>>>>>> frequency=44100' will set the
>>>>>> in's frequency to 44100 and leave out's frequency unspecified).
>>>>>>
>>>>>> This patch fixes it, by the following changes:
>>>>>> 1) Specifying just the field name will apply to all fields that has the
>>>>>>      specified name (this means it would set both in's and out's
>>>>>> frequency to
>>>>>>      44100 in the above example).
>>>
>>> What if they have different types?
>>>
>>> What if one of them can't take the value?
>>
>> Currently it will error out, requiring the user to be more
>> explicit. Probably not the best solution, but I can't really think of
>> a better solution. (If we would ignore invalid values that would be
>> very confusing imho.)
>
> Yes, we clearly don't want foo=0 to set a.foo and b.foo, but foo=x set
> only a.foo, because the former can take any string, but the latter only
> a number.
>
> Can we require the LHS to be unambiguous?

Originally I designed it that way because it allows you to specify 
frequency=44100 and set both in.frequency and out.frequency. But this 
could also be the convenience feature that we not really need. I don't 
see any other downside of making it unambigous.

  reply	other threads:[~2015-06-17 14:04 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16 12:49 [Qemu-devel] [PATCH v2 0/6] -audiodev option Kővágó, Zoltán
2015-06-16 12:49 ` [Qemu-devel] [PATCH v2 1/6] qapi: qapi for audio backends Kővágó, Zoltán
2015-06-17  7:46   ` Markus Armbruster
2015-06-17 10:54     ` Kővágó Zoltán
2015-06-17 11:48       ` Markus Armbruster
2015-06-17 12:07         ` Kővágó Zoltán
2015-06-17 13:37           ` Markus Armbruster
2015-06-17 13:53             ` Kővágó Zoltán
2015-06-17 16:06               ` Markus Armbruster
2015-06-18  0:21                 ` Kővágó Zoltán
2015-06-18  8:51                   ` Markus Armbruster
2015-06-17 15:50         ` Eric Blake
2015-06-16 12:49 ` [Qemu-devel] [PATCH v2 2/6] qapi: support nested structs in OptsVisitor Kővágó, Zoltán
2015-06-17  7:50   ` Markus Armbruster
2015-06-17  8:41     ` Gerd Hoffmann
2015-06-17 11:01       ` Kővágó Zoltán
2015-06-17 11:50         ` Markus Armbruster
2015-06-17 15:47         ` Eric Blake
2015-06-17 11:18       ` Markus Armbruster
2015-06-17 12:11         ` Kővágó Zoltán
2015-06-17 13:41           ` Markus Armbruster
2015-06-17 14:02             ` Kővágó Zoltán [this message]
2015-06-17 16:10               ` Markus Armbruster
2015-06-16 12:49 ` [Qemu-devel] [PATCH v2 3/6] opts: do not print separator before first item in qemu_opts_print Kővágó, Zoltán
2015-06-17  7:53   ` Markus Armbruster
2015-06-17  9:02   ` Kevin Wolf
2015-06-16 12:49 ` [Qemu-devel] [PATCH v2 4/6] qapi: AllocVisitor Kővágó, Zoltán
2015-06-17  7:56   ` Markus Armbruster
2015-06-17 12:01     ` Kővágó Zoltán
2015-06-17 13:42       ` Markus Armbruster
2015-06-16 12:49 ` [Qemu-devel] [PATCH v2 5/6] audio: use qapi AudioFormat instead of audfmt_e Kővágó, Zoltán
2015-06-17  8:01   ` Markus Armbruster
2015-06-17 11:05     ` Kővágó Zoltán
2015-06-17 11:51       ` Markus Armbruster
2015-06-17 16:01         ` Eric Blake
2015-06-16 12:49 ` [Qemu-devel] [PATCH v2 6/6] audio: -audiodev command line option Kővágó, Zoltán
2015-06-17  8:13   ` Markus Armbruster
2015-06-17 11:18     ` Kővágó Zoltán
2015-06-17 12:27       ` Markus Armbruster
2015-06-17 13:25         ` Kővágó Zoltán
2015-06-17 16:13           ` Markus Armbruster
2015-06-18  6:54             ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55817DD8.6060605@gmail.com \
    --to=dirty.ice.hu@gmail.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.