Peter Maydell <[email protected]> writes: > On Fri, 15 Oct 2021 at 16:01, Kevin Wolf <[email protected]> wrote: >> QDicts are both what QMP natively uses and what the keyval parser >> produces. Going through QemuOpts isn't useful for either one, so switch >> the main device creation function to QDicts. By sharing more code with >> the -object/object-add code path, we can even reduce the code size a >> bit. >> >> This commit doesn't remove the detour through QemuOpts from any code >> path yet, but it allows the following commits to do so. >> >> Signed-off-by: Kevin Wolf <[email protected]> >> Message-Id: <[email protected]> >> Reviewed-by: Michael S. Tsirkin <[email protected]> >> Tested-by: Peter Krempa <[email protected]> >> Signed-off-by: Kevin Wolf <[email protected]> > > Hi; we discovered via a report on IRC this this commit broke > handling of "array properties", of which one example is: > qemu-system-x86_64 -netdev user,id=a -device rocker,len-ports=1,ports[0]=a > > This used to work, and now fails with > qemu-system-x86_64: -device rocker,len-ports=1,ports[0]=a: Property > 'rocker.ports[0]' not found > > I think this happens because array properties have the > requirement that the len-foo property is set first before > any of the foo[n] properties can be set. In the old code > I guess we used to set properties from the command line > in the order they were specified, whereas in the new code > we end up in object_set_properties_from_qdict() which > tries to set them in whatever order the qdict hash table > provides them, which turns out to be the wrong one :-( > > Any suggestions for how to address this ?
My initial (knee-jerk) reaction to breaking array properties: Faster, Pussycat! Kill! Kill! Back to serious: replace the implementation of QDict so it iterates in order?
