From 88c725c78e87eecb061f882177c7a6a2ac1059ad Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Fri, 7 Jul 2017 11:45:26 +0200 Subject: kvm: remove hard dependency on pci The msi routing code in kvm calls some pci functions: provide some stubs to enable builds without pci. Also, to make this more obvious, guard them via a pci_available boolean (which also can be reused in other places). Fixes: e1d4fb2de ("kvm-irqchip: x86: add msi route notify fn") Fixes: 767a554a0 ("kvm-all: Pass requester ID to MSI routing functions") Reviewed-by: Pierre Morel Reviewed-by: Thomas Huth Acked-by: Christian Borntraeger Signed-off-by: Cornelia Huck --- hw/pci/pci-stub.c | 14 ++++++++++++++ hw/pci/pci.c | 2 ++ 2 files changed, 16 insertions(+) (limited to 'hw') diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c index ecad664946..d5ce00748e 100644 --- a/hw/pci/pci-stub.c +++ b/hw/pci/pci-stub.c @@ -27,6 +27,7 @@ #include "hw/pci/msi.h" bool msi_nonbroken; +bool pci_available; PciInfoList *qmp_query_pci(Error **errp) { @@ -38,3 +39,16 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict) { monitor_printf(mon, "PCI devices not supported\n"); } + +/* kvm-all wants this */ +MSIMessage pci_get_msi_message(PCIDevice *dev, int vector) +{ + g_assert(false); + return (MSIMessage){}; +} + +uint16_t pci_requester_id(PCIDevice *dev) +{ + g_assert(false); + return 0; +} diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 258fbe51e2..26f346db2c 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -49,6 +49,8 @@ # define PCI_DPRINTF(format, ...) do { } while (0) #endif +bool pci_available = true; + static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent); static char *pcibus_get_dev_path(DeviceState *dev); static char *pcibus_get_fw_dev_path(DeviceState *dev); -- cgit v1.2.3