|
@@ -937,6 +937,13 @@ static Property xen_pci_passthrough_properties[] = {
|
|
DEFINE_PROP_END_OF_LIST(),
|
|
DEFINE_PROP_END_OF_LIST(),
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+static void xen_pci_passthrough_instance_init(Object *obj)
|
|
|
|
+{
|
|
|
|
+ /* QEMU_PCI_CAP_EXPRESS initialization does not depend on QEMU command
|
|
|
|
+ * line, therefore, no need to wait to realize like other devices */
|
|
|
|
+ PCI_DEVICE(obj)->cap_present |= QEMU_PCI_CAP_EXPRESS;
|
|
|
|
+}
|
|
|
|
+
|
|
static void xen_pci_passthrough_class_init(ObjectClass *klass, void *data)
|
|
static void xen_pci_passthrough_class_init(ObjectClass *klass, void *data)
|
|
{
|
|
{
|
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
|
@@ -946,7 +953,6 @@ static void xen_pci_passthrough_class_init(ObjectClass *klass, void *data)
|
|
k->exit = xen_pt_unregister_device;
|
|
k->exit = xen_pt_unregister_device;
|
|
k->config_read = xen_pt_pci_read_config;
|
|
k->config_read = xen_pt_pci_read_config;
|
|
k->config_write = xen_pt_pci_write_config;
|
|
k->config_write = xen_pt_pci_write_config;
|
|
- k->is_express = 1; /* We might be */
|
|
|
|
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
|
|
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
|
|
dc->desc = "Assign an host PCI device with Xen";
|
|
dc->desc = "Assign an host PCI device with Xen";
|
|
dc->props = xen_pci_passthrough_properties;
|
|
dc->props = xen_pci_passthrough_properties;
|
|
@@ -965,6 +971,7 @@ static const TypeInfo xen_pci_passthrough_info = {
|
|
.instance_size = sizeof(XenPCIPassthroughState),
|
|
.instance_size = sizeof(XenPCIPassthroughState),
|
|
.instance_finalize = xen_pci_passthrough_finalize,
|
|
.instance_finalize = xen_pci_passthrough_finalize,
|
|
.class_init = xen_pci_passthrough_class_init,
|
|
.class_init = xen_pci_passthrough_class_init,
|
|
|
|
+ .instance_init = xen_pci_passthrough_instance_init,
|
|
.interfaces = (InterfaceInfo[]) {
|
|
.interfaces = (InterfaceInfo[]) {
|
|
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
|
|
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
|
|
{ INTERFACE_PCIE_DEVICE },
|
|
{ INTERFACE_PCIE_DEVICE },
|