[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/2] qapi/qom: use correct field name when getting/setting al
Re: [PATCH 0/2] qapi/qom: use correct field name when getting/setting alias properties
Wed, 21 Jul 2021 13:50:40 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0
On 20/07/21 17:54, Markus Armbruster wrote:
First, let me describe what's wrong in my own words, because that's how
I understand stuff.
Next, the solution. I get the idea of a wrapper visitor which gives you
"pflash0" when you ask for "drive", but oh boy do I wish we could fix
the bug with a lot less code.
Yeah, if QOM didn't use visitors and just went with QObject as the
argument to getters/setters, all this wouldn't be needed.
That said, 1/3rd of this patch is tests, and visitors do have a hidden
advantage: they give type checking for free. So all in all I'm not sure
it would be better, especially now that we're starting to get more
benefit from them (e.g. with compound properties replacing
special-purpose command line parsing code).