October 21, 2024 at 8:07 PM, "Pierrick Bouvier" wrote:
> On 10/19/24 09:39, Julian Ganz wrote:
> >  + max_vcpus = info->system.max_vcpus;
> >  + traps = calloc(max_vcpus, sizeof(TrapCounters));
> > 
> Instead of allocating data for max number of vcpu, you can use a 
> qemu_plugin_scoreboard, which was introduced recently, and covers exactly 
> this need, by providing an array that gets automatically redimensioned when a 
> vcpu is added.
> 
> A simple example using it can be found with bb plugin:
> https://gitlab.com/qemu-project/qemu/-/blob/master/tests/tcg/plugins/b(id, 
> vb.c

Thanks for pointing this out! I scrolled past the scoreboard API at least once 
without realizing what it was.

Regards,
Julian

Reply via email to