[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 13/17] vfio-user: handle DMA mappings
From: |
Jag Raman |
Subject: |
Re: [PATCH v8 13/17] vfio-user: handle DMA mappings |
Date: |
Mon, 25 Apr 2022 17:34:44 +0000 |
> On Apr 25, 2022, at 5:56 AM, Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> On Tue, Apr 19, 2022 at 04:44:18PM -0400, Jagannathan Raman wrote:
>> +static void dma_unregister(vfu_ctx_t *vfu_ctx, vfu_dma_info_t *info)
>> +{
>> + VfuObject *o = vfu_get_private(vfu_ctx);
>> + AddressSpace *dma_as = NULL;
>> + MemoryRegion *mr = NULL;
>> + ram_addr_t offset;
>> +
>> + mr = memory_region_from_host(info->vaddr, &offset);
>> + if (!mr) {
>> + return;
>> + }
>> +
>> + dma_as = pci_device_iommu_address_space(o->pci_dev);
>> +
>> + memory_region_del_subregion(dma_as->root, mr);
>> +
>> + object_unparent((OBJECT(mr)));
>
> Where is obj->parent set?
Yeah, it should be object_unref().
Thank you!
--
Jag
>
> If it is not set then this call is a nop and mr is not freed:
>
> void object_unparent(Object *obj)
> {
> if (obj->parent) {
> object_property_del_child(obj->parent, obj);
> }
> }
[PATCH v8 13/17] vfio-user: handle DMA mappings, Jagannathan Raman, 2022/04/19
[PATCH v8 14/17] vfio-user: handle PCI BAR accesses, Jagannathan Raman, 2022/04/19
[PATCH v8 15/17] vfio-user: handle device interrupts, Jagannathan Raman, 2022/04/19
[PATCH v8 16/17] vfio-user: handle reset of remote device, Jagannathan Raman, 2022/04/19