summaryrefslogtreecommitdiff
path: root/hw/pci
diff options
context:
space:
mode:
authorCornelia Huck <cohuck@redhat.com>2017-07-07 11:45:26 +0200
committerCornelia Huck <cohuck@redhat.com>2017-08-30 18:23:25 +0200
commit88c725c78e87eecb061f882177c7a6a2ac1059ad (patch)
treee5076aa2e2219460f4a6ca9b0a4cda8f345fe32e /hw/pci
parent5f8c92e1d50d3629116497dd0a446e8cb28af7f8 (diff)
downloadqemu-88c725c78e87eecb061f882177c7a6a2ac1059ad.tar.gz
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 <pmorel@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'hw/pci')
-rw-r--r--hw/pci/pci-stub.c14
-rw-r--r--hw/pci/pci.c2
2 files changed, 16 insertions, 0 deletions
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);