[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] What's IOMMUMemoryRegion's super?
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] What's IOMMUMemoryRegion's super? |
Date: |
Wed, 03 Jul 2019 12:37:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Paolo Bonzini <address@hidden> writes:
> On 03/07/19 07:05, Markus Armbruster wrote:
>> static const TypeInfo iommu_memory_region_info = {
>> .parent = TYPE_MEMORY_REGION,
>> .name = TYPE_IOMMU_MEMORY_REGION,
>> .class_size = sizeof(IOMMUMemoryRegionClass),
>> .instance_size = sizeof(IOMMUMemoryRegion),
>> .instance_init = iommu_memory_region_initfn,
>> .abstract = true,
>> };
>>
>> typedef struct IOMMUMemoryRegionClass {
>> /* private */
>> ---> struct DeviceClass parent_class;
>> [...]
>> };
>>
>> struct IOMMUMemoryRegion {
>> MemoryRegion parent_obj;
>> [...]
>> };
>>
>> The parent is TYPE_MEMORY_REGION, and the instance struct's first member is
>> TYPE_MEMORY_REGION's instance struct as I expect, but the class struct's
>> first member is something else entirely.
>
> Cut-and-paste error. MemoryRegion adds no methods so that could be
I wonder whether there's anything we could do to catch such errors
automatically.
> either ObjectClass or better
>
> typedef struct MemoryRegionClass {
> /* private */
> ObjectClass parent_class;
> } ObjectClass;
I'll prepare the patch. Thanks!