On 4/27/24 10:12, Akihiko Odaki wrote: >> int virtio_gpu_virgl_get_num_capsets(VirtIOGPU *g) >> { >> uint32_t capset2_max_ver, capset2_max_size; >> + >> + if (g->capset_ids) { > > Move capset_ids initialization to virtio_gpu_virgl_init() to save this > conditional.
Capsets are used before virgl is inited. At first guest queries virtio device features and then enables virgl only if capset is available. While virgl itself is initialized when first virtio command is processed. I.e. it's not possible to move to virtio_gpu_virgl_init. > capset_ids also needs to be freed when the device gets > unrealized. ACK -- Best regards, Dmitry