All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: QMP configuration - allocating/setting qdev array properties?
@ 2022-01-11 16:54 Mirela Grujic
  2022-01-12  9:47 ` Damien Hedde
  0 siblings, 1 reply; 5+ messages in thread
From: Mirela Grujic @ 2022-01-11 16:54 UTC (permalink / raw)
  To: qemu-devel, Markus Armbruster, Paolo Bonzini
  Cc: Edgar E. Iglesias, Damien Hedde, jsnow, Mark Burton

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-25  7:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-11 16:54 RFC: QMP configuration - allocating/setting qdev array properties? Mirela Grujic
2022-01-12  9:47 ` Damien Hedde
2022-01-19 10:12   ` Markus Armbruster
2022-01-24 19:09     ` John Snow
2022-01-25  6:38       ` Markus Armbruster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.