qdev: Add qdev_prop_set_array()
commit32400a7e872fe620ab52ec32521e839a71ffb54c
authorKevin Wolf <kwolf@redhat.com>
Mon, 30 Oct 2023 11:47:59 +0000 (30 11:47 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 2 Nov 2023 12:52:06 +0000 (2 12:52 +0000)
tree4e649fd085172625b3ef5799e50c4da00d75661a
parent281e461820db96a017ebf0fc36474d36feb33902
qdev: Add qdev_prop_set_array()

Instead of exposing the ugly hack of how we represent arrays in qdev (a
static "foo-len" property and after it is set, dynamically created
"foo[i]" properties) to boards, add an interface that allows setting the
whole array at once.

Once all internal users of devices with array properties have been
converted to use this function, we can change the implementation to move
away from this hack.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20231030114802.3671871-4-peter.maydell@linaro.org
hw/core/qdev-properties.c
include/hw/qdev-properties.h