|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [v4][PATCH 3/5] I440FX_PCI_DEVICE: add pci_type to index
On 2014/8/7 5:07, Michael S. Tsirkin wrote: On Wed, Aug 06, 2014 at 06:17:02PM +0800, Chen, Tiejun wrote:On 2014/8/6 17:45, Michael S. Tsirkin wrote:On Wed, Aug 06, 2014 at 02:50:33PM +0800, Tiejun Chen wrote:We need to use this index to reuse this macro later Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx>Which index? Most users don't need to change. Just open-code OBJECT_CHECK where necessary, or add a new wrapper. Why? We will have two different QOM typenames of PCII440FXStates. there is no reason not to use TYPE_I440FX_PCI_DEVICE.
As you know we already have this original,
static const TypeInfo i440fx_info = {
.name = TYPE_I440FX_PCI_DEVICE,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(PCII440FXState),
.class_init = i440fx_class_init,
};
and in patch #4, we will register that new host bridge to IGD passthrough:
static const TypeInfo xen_igd_passthrough_i440fx_info = {
.name = TYPE_XEN_IGD_PASSTHROUGH_I440FX_PCI_DEVICE,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(PCII440FXState),
.class_init = xen_igd_passthrough_i440fx_class_init,
};
After that, we have two different QOM typenames of PCII440FXStates,
TYPE_I440FX_PCI_DEVICE and TYPE_XEN_IGD_PASSTHROUGH_I440FX_PCI_DEVICE,
right? So if you think we still should use this original,
#define I440FX_PCI_DEVICE(obj) \
OBJECT_CHECK(PCII440FXState, (obj), TYPE_I440FX_PCI_DEVICE)
I really don't understand how to distinguish TYPE_I440FX_PCI_DEVICE and
TYPE_XEN_IGD_PASSTHROUGH_I440FX_PCI_DEVICE just with I440FX_PCI_DEVICE(obj).
This should involve two places:
#1: static int i440fx_initfn(PCIDevice *dev)
{
PCII440FXState *d = I440FX_PCI_DEVICE(dev);
...
#2: PCIBus *i440fx_init(const char *host_type, const char *pci_type,
PCII440FXState **pi440fx_state,
int *piix3_devfn,
ISABus **isa_bus, qemu_irq *pic,
MemoryRegion *address_space_mem,
MemoryRegion *address_space_io,
ram_addr_t ram_size,
ram_addr_t below_4g_mem_size,
ram_addr_t above_4g_mem_size,
MemoryRegion *pci_address_space,
MemoryRegion *ram_memory)
{
...
PCIDevice *d;
...
*pi440fx_state = I440FX_PCI_DEVICE(d);
...
So if you think I'm wrong please show me how to do just with
I440FX_PCI_DEVICE() to work all scenarios from your point of view, then
I'd like to followup yours to validate.
Thanks Tiejun
_______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |