[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] Clean up upcast from PCIDevice to I6300Stat
Re: [Qemu-devel] [PATCH 2/3] Clean up upcast from PCIDevice to I6300State
Mon, 24 Aug 2009 17:07:25 +0200
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2
play. However, the *next* commit (conversion to qdev) is wrong if qdev
requires the PCIDevice at offset zero (not obvious to me, document it?).
qdev_create() allocates DeviceInfo->size bytes for you and assumes
DeviceState starts at offset zero of your FooDeviceState. I think that
is the only place though.
Could probably be relaxed by adding a offset field to DeviceInfo, but I
don't think that buys us much, so unless there is some real need I'd
just go with the "DeviceState must be first" convention.
It also could be that there is some old code which does casts instead of
using DO_UPCAST, especially for PCI because PCIDevice predates qdev.
That I'd consider a bug though.
[Qemu-devel] [PATCH 1/3] Move watchdog, watchdog_action, give them internal linkage, Markus Armbruster, 2009/08/21
[Qemu-devel] [PATCH 2/3] Clean up upcast from PCIDevice to I6300State, Markus Armbruster, 2009/08/21
Re: [Qemu-devel] [PATCH 2/3] Clean up upcast from PCIDevice to I6300State, Paul Brook, 2009/08/24
- Re: [Qemu-devel] [PATCH 3/3] qdev: convert watchdogs, (continued)