From: Kevin Wolf <kwolf@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Eduardo Habkost <eduardo@habkost.net>,
Paolo Bonzini <pbonzini@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [PATCH] hw: forbid DEFINE_PROP_ARRAY for user creatable devices
Date: Fri, 8 Sep 2023 14:26:12 +0200 [thread overview]
Message-ID: <ZPsS5BHFNhZDDHJC@redhat.com> (raw)
In-Reply-To: <20230908092951.2683721-1-berrange@redhat.com>
Am 08.09.2023 um 11:29 hat Daniel P. Berrangé geschrieben:
> The DEFINE_PROP_ARRAY macro is a clever trick for defining array
> properties. It initially creates a property "len-$FOO". When that
> property is set, then it creates a sequence "$FOO[NN]" for NN
> in the range 0 to "len-$FOO".
>
> The intended usage for this was to simplify code for internal
> devices, however, it crept into use for user creatable devices
> when the 'rocker' network device used it.
>
> This relied on the user specifying the len property first on
> the -device comand line, and the args being processed in-order.
> The latter was broken[1] when -device was converted from QemuOpts
> to QDict[2], as ordering of loading properties was no longer
> guaranteed to match user specified ordering.
>
> This change poisons the setter for "len-$FOO" such that it raises
> an error when used with a user creatable device.
>
> This allows DEFINE_PROP_ARRAY to remain exclusively for internal
> devices, since code can ensure properties are set in the correct
> ordering.
>
> [1] https://gitlab.com/qemu-project/qemu/-/issues/1090
> [2] f3558b1b763683bb877f7dd5b282469cdadc65c3
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
NACK.
This doesn't fix the problem, but breaks rocker for good. As I said, I'm
working on proper array support and will send patches soon.
Kevin
prev parent reply other threads:[~2023-09-08 12:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 9:29 [PATCH] hw: forbid DEFINE_PROP_ARRAY for user creatable devices Daniel P. Berrangé
2023-09-08 12:26 ` Kevin Wolf [this message]
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=ZPsS5BHFNhZDDHJC@redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eduardo@habkost.net \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).