diff options
author | Anthony PERARD <anthony.perard@citrix.com> | 2020-06-03 17:04:42 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-06-12 11:20:12 -0400 |
commit | acd0c9416d4846afc541605ee0e75ca163773e6c (patch) | |
tree | 946401b4d89b06ed4953a9c6e8bfc73b1dcb63da /hw/xen/xen_pt.h | |
parent | e77cb0bb204c18c04a8290e03181510bbbfc683a (diff) | |
download | qemu-acd0c9416d4846afc541605ee0e75ca163773e6c.zip qemu-acd0c9416d4846afc541605ee0e75ca163773e6c.tar.gz qemu-acd0c9416d4846afc541605ee0e75ca163773e6c.tar.bz2 |
xen: fix build without pci passthrough
Xen PCI passthrough support may not be available and thus the global
variable "has_igd_gfx_passthru" might be compiled out. Common code
should not access it in that case.
Unfortunately, we can't use CONFIG_XEN_PCI_PASSTHROUGH directly in
xen-common.c so this patch instead move access to the
has_igd_gfx_passthru variable via function and those functions are
also implemented as stubs. The stubs will be used when QEMU is built
without passthrough support.
Now, when one will want to enable igd-passthru via the -machine
property, they will get an error message if QEMU is built without
passthrough support.
Fixes: 46472d82322d0 ('xen: convert "-machine igd-passthru" to an accelerator property')
Reported-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20200603160442.3151170-1-anthony.perard@citrix.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/xen/xen_pt.h')
-rw-r--r-- | hw/xen/xen_pt.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h index 179775d..6e9cec9 100644 --- a/hw/xen/xen_pt.h +++ b/hw/xen/xen_pt.h @@ -5,6 +5,9 @@ #include "hw/pci/pci.h" #include "xen-host-pci-device.h" +bool xen_igd_gfx_pt_enabled(void); +void xen_igd_gfx_pt_set(bool value, Error **errp); + void xen_pt_log(const PCIDevice *d, const char *f, ...) GCC_FMT_ATTR(2, 3); #define XEN_PT_ERR(d, _f, _a...) xen_pt_log(d, "%s: Error: "_f, __func__, ##_a) @@ -322,10 +325,9 @@ extern void *pci_assign_dev_load_option_rom(PCIDevice *dev, unsigned int domain, unsigned int bus, unsigned int slot, unsigned int function); -extern bool has_igd_gfx_passthru; static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev) { - return (has_igd_gfx_passthru + return (xen_igd_gfx_pt_enabled() && ((dev->class_code >> 0x8) == PCI_CLASS_DISPLAY_VGA)); } int xen_pt_register_vga_regions(XenHostPCIDevice *dev); |