|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [v2][PATCH 2/5] hw:pci-host:piix: split i440fx_init
On 2014/7/31 17:10, Michael S. Tsirkin wrote: On Thu, Jul 31, 2014 at 02:31:36PM +0800, Tiejun Chen wrote:We'd like to split i440fx_init and then we can share something with other stuff. Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx>I think this is too much work for very little benefit. Just pass const char *type to i440fx_init. You know we will introduce that faked PCIe device represented that PCH later, so how to distinguish them? Are you saying I should check the type like this?
if(Xen-Type)
{}
else
{}
If so, actually this is mostly same as my original implementation,
"
@@ -333,8 +348,15 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state,
object_property_add_child(qdev_get_machine(), "i440fx",
OBJECT(dev), NULL);
qdev_init_nofail(dev);
- d = pci_create_simple(b, 0, TYPE_I440FX_PCI_DEVICE);
- *pi440fx_state = I440FX_PCI_DEVICE(d);
+ if (xen_enabled() && xen_has_gfx_passthru) {
+ d = pci_create_simple(b, 0, TYPE_I440FX_XEN_PCI_DEVICE);
+ *pi440fx_state = I440FX_XEN_PCI_DEVICE(d);
+ pci_create_pch(b);
+ } else {
+ d = pci_create_simple(b, 0, TYPE_I440FX_PCI_DEVICE);
+ *pi440fx_state = I440FX_PCI_DEVICE(d);
+ }
+
f = *pi440fx_state;
f->system_memory = address_space_mem;
f->pci_address_space = pci_address_space;
"
But as I said to you last time, Paolo doesn't like we walk the common
codes :)
Tiejun _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |