|
From: | Anthony Liguori |
Subject: | Re: [Qemu-ppc] [Qemu-devel] [PATCH 27/28] sysbus: apic: ioapic: convert to QEMU Object Model |
Date: | Wed, 25 Jan 2012 08:40:36 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15 |
On 01/25/2012 08:23 AM, Jan Kiszka wrote:
On 2012-01-25 15:00, Anthony Liguori wrote:On 01/25/2012 02:37 AM, Jan Kiszka wrote:On 2012-01-25 00:03, Anthony Liguori wrote:They're exactly the same size (16 lines). If you embed TypeInfo into DeviceTypeInfo, and introduce a Device specific type registration function, then you could do: static DeviceTypeInfo my_device_type_info = { .type.name = TYPE_MY_DEVICE, .type.parent = TYPE_PARENT_DEVICE, .reset = my_device_reset,And if you introduce some #define TYPE_UNIMPLEMENTED (void *)&dummy_variable(void *) isn't compatible with integers or function pointers (at least not in a portable way).
I don't see how they can be compatible since on some platforms sizeof(void (*)(void)) != sizeof(void *).
The former is true, the latter not. However, if you use pointers in the TypeInfo structs consistently (const int * etc.), this issue should be solvable as well.
How would you handle PCIDeviceInfo?
I'm not being dismissive, I've already spent a lot of time trying to make it work and have convinced myself that it isn't workable. If you can show a mechanism that works, I don't mind scripting a mass conversion. I'm also fairly confident that a workable solution is going to be better than what we have.Well, I'm surely not happy having to go through all of the devices again, even if scripted (scripts tend to neglect some coding style rules e.g.). But if this change is in a hurry and my concern is the only one, then let it be.
I wouldn't be happy with it either, but in the absence of a concrete counter proposal and given that I've spent a fair amount of time trying to figure this out, I strongly believe we won't need to make the change.
I'm happy to be proven wrong though. Regards, Anthony Liguori
Jan
[Prev in Thread] | Current Thread | [Next in Thread] |