All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Steven Sistare <steven.sistare@oracle.com>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>,
	"Michael Roth" <michael.roth@amd.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH V2 1/4] qapi: strList_from_string
Date: Mon, 19 Jun 2023 07:52:02 +0200	[thread overview]
Message-ID: <87a5ww2e4d.fsf@pond.sub.org> (raw)
In-Reply-To: <27092461-aa2c-5a0e-ea9d-3742d9284a15@oracle.com> (Steven Sistare's message of "Thu, 15 Jun 2023 17:25:21 -0400")

Steven Sistare <steven.sistare@oracle.com> writes:

> On 6/13/2023 8:33 AM, Markus Armbruster wrote:
>> Steven Sistare <steven.sistare@oracle.com> writes:

[...]

>>> What design principle does strList_from_string contradict?  Are you OK with 
>>> putting the simplified version shown above in qapi-util?
>> 
>> The design principle is "use JSON to encode structured data as text in
>> QAPI/QMP".
>> 
>> Do: "mumble": [1, 2, 3]
>> 
>> Don't: "mumble": "1,2,3"
>
> I don't mumble, but I sometimes mutter and ramble.

Hah!

>> We violate the principle in a couple of places.  Some are arguably
>> mistakes, some are pragmatic exceptions.
>> 
>> The principle implies "the only parser QAPI needs is the JSON parser".
>> 
>> By adding other parsers to QAPI, we send a misleading signal, namely
>> that encoding structured data in a way that requires parsing is okay.
>> It's not, generally.
>> 
>> So, I'd prefer to find another home for code that splits strings at
>> comma / delimiter.
>> 
>>> (and apologies for my long delay in continuing this conversation).
>> 
>> I'm in no position to take offense there ;)
>
> Thanks, that makes it clear.
>
> I propose to move strList_from_string and strv_from_strList to new files
> util/strList.c and include/qemu/strList.h, and leave QAPI_LIST_LENGTH in 
> include/qapi/util.h.
>
> (cutil.c already has string functions, but only uses simple C types, so
> not the best place to add the strList type).
>
> Sound OK?

Works for me.  Thanks!



  reply	other threads:[~2023-06-19  5:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 18:48 [PATCH V2 0/4] string list functions Steve Sistare
2023-02-07 18:48 ` [PATCH V2 1/4] qapi: strList_from_string Steve Sistare
2023-02-08  6:43   ` Marc-André Lureau
2023-02-08 13:05     ` Steven Sistare
2023-02-08 14:17       ` Alex Bennée
2023-02-09 10:02         ` Markus Armbruster
2023-02-09 14:41           ` Steven Sistare
2023-02-09 16:46             ` Markus Armbruster
2023-02-09 17:00               ` Steven Sistare
2023-02-09 18:59                 ` Markus Armbruster
2023-02-09 21:34                   ` Steven Sistare
2023-02-10  9:25                     ` Markus Armbruster
2023-06-07 13:54                       ` Steven Sistare
2023-06-13 12:33                         ` Markus Armbruster
2023-06-15 21:25                           ` Steven Sistare
2023-06-19  5:52                             ` Markus Armbruster [this message]
2023-02-07 18:48 ` [PATCH V2 2/4] qapi: QAPI_LIST_LENGTH Steve Sistare
2023-02-07 18:48 ` [PATCH V2 3/4] qapi: strv_from_strList Steve Sistare
2023-02-07 18:48 ` [PATCH V2 4/4] qapi: strList unit tests Steve Sistare
2023-02-09 10:05 ` [PATCH V2 0/4] string list functions Markus Armbruster
2023-02-09 14:42   ` Steven Sistare
2023-02-09 16:39     ` Markus Armbruster
2023-02-09 10:48 ` Daniel P. Berrangé
2023-02-09 14:42   ` Steven Sistare
2023-02-10  8:57   ` Markus Armbruster

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=87a5ww2e4d.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=marcandre.lureau@gmail.com \
    --cc=michael.roth@amd.com \
    --cc=qemu-devel@nongnu.org \
    --cc=steven.sistare@oracle.com \
    /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.