On Thu, Mar 05, 2026 at 10:24:51PM +0800, Zhang Chen wrote:
> Replace raw object_ref/unref calls with iothread_get/put_aio_context
> in iothread-vq-mapping. This allows tracking IOThread users via
> the device's canonical QOM path, improving lifecycle traceability
> for virtio-blk and virtio-scsi devices.
> 
> Signed-off-by: Zhang Chen <[email protected]>
> ---
>  hw/block/virtio-blk.c                   | 10 +++++++++-
>  hw/scsi/virtio-scsi-dataplane.c         | 11 +++++++++--
>  hw/virtio/iothread-vq-mapping.c         | 11 +++++------
>  include/hw/virtio/iothread-vq-mapping.h |  6 +++++-
>  4 files changed, 28 insertions(+), 10 deletions(-)
> 
> diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> index ddf0e9ee53..b6f74df68f 100644
> --- a/hw/block/virtio-blk.c
> +++ b/hw/block/virtio-blk.c
> @@ -1453,14 +1453,19 @@ static bool 
> virtio_blk_vq_aio_context_init(VirtIOBlock *s, Error **errp)
>      s->vq_aio_context = g_new(AioContext *, conf->num_queues);
>  
>      if (conf->iothread_vq_mapping_list) {
> +        char *path = object_get_canonical_path(OBJECT(vdev));

The g_free() calls can be avoided with:

  g_autofree char *path = ...;

The same applies throughout the rest of this patch series.

Attachment: signature.asc
Description: PGP signature

Reply via email to