[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen: fix build without pci passthrough

Hi Roger,

On 5/4/20 12:14 PM, Roger Pau Monne wrote:
has_igd_gfx_passthru is only available when QEMU is built with
CONFIG_XEN_PCI_PASSTHROUGH, and hence shouldn't be used in common
code without checking if it's available.

Fixes: 46472d82322d0 ('xen: convert "-machine igd-passthru" to an accelerator 
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

See Kconfig fix suggested here:

Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>
Cc: Paul Durrant <paul@xxxxxxx>
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
  hw/xen/xen-common.c | 4 ++++
  hw/xen/xen_pt.h     | 7 +++++++
  2 files changed, 11 insertions(+)

diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c
index a15070f7f6..c800862419 100644
--- a/hw/xen/xen-common.c
+++ b/hw/xen/xen-common.c
@@ -127,6 +127,7 @@ static void xen_change_state_handler(void *opaque, int 
  static bool xen_get_igd_gfx_passthru(Object *obj, Error **errp)
      return has_igd_gfx_passthru;
@@ -136,6 +137,7 @@ static void xen_set_igd_gfx_passthru(Object *obj, bool 
value, Error **errp)
      has_igd_gfx_passthru = value;
static void xen_setup_post(MachineState *ms, AccelState *accel)
@@ -197,11 +199,13 @@ static void xen_accel_class_init(ObjectClass *oc, void 
compat_props_add(ac->compat_props, compat, G_N_ELEMENTS(compat)); +#ifdef CONFIG_XEN_PCI_PASSTHROUGH
      object_class_property_add_bool(oc, "igd-passthru",
          xen_get_igd_gfx_passthru, xen_set_igd_gfx_passthru,
      object_class_property_set_description(oc, "igd-passthru",
          "Set on/off to enable/disable igd passthrou", &error_abort);
diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h
index 179775db7b..660dd8a008 100644
--- a/hw/xen/xen_pt.h
+++ b/hw/xen/xen_pt.h
@@ -1,6 +1,7 @@
  #ifndef XEN_PT_H
  #define XEN_PT_H
+#include "qemu/osdep.h"
  #include "hw/xen/xen_common.h"
  #include "hw/pci/pci.h"
  #include "xen-host-pci-device.h"
@@ -322,7 +323,13 @@ extern void *pci_assign_dev_load_option_rom(PCIDevice *dev,
                                              unsigned int domain,
                                              unsigned int bus, unsigned int 
                                              unsigned int function);
  extern bool has_igd_gfx_passthru;
+# define has_igd_gfx_passthru false
  static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev)
      return (has_igd_gfx_passthru



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.