qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFC: QMP configuration - allocating/setting qdev array properties?


From: Mirela Grujic
Subject: RFC: QMP configuration - allocating/setting qdev array properties?
Date: Tue, 11 Jan 2022 17:54:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

Hi,


While working on a prototype and configuring a whole machine using QMP we run into the following scenario.


Some device models use array properties. The array is allocated when len-<arrayname> property is set, then, individual elements of the array can be set as any other property (see description above the DEFINE_PROP_ARRAY definition in qdev-properties.h for more details). We need to do both (allocate the array and set its elements) before the device can be realized. Attempting to set len-<arrayname> and array elements in a single device_add command does not work because the order of setting properties is not guaranteed, i.e. we're likely attempting to set an element of the array that's not yet allocated.

Allowing the device initialize and realize phases to be split would solve this problem. For example, the device_add would be issued with 'realized=false', we can set the len-<arrayname> in the same device_add command or a following qom-set command, then we would use a sequence of qom-set commands to set array elements, and at the end, we would realize the device by issuing qom-set path=<device_id> property=realized value=true. This is what we currently do in our prototype.

Another situation where we found that splitting initialize and realize phases would solve a problem has been presented here: https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg07272.html


We would appreciate your feedback, any other proposals for solving both problems are welcome.


Thanks,

Mirela





reply via email to

[Prev in Thread] Current Thread [Next in Thread]