From acd0c9416d4846afc541605ee0e75ca163773e6c Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Wed, 3 Jun 2020 17:04:42 +0100 Subject: xen: fix build without pci passthrough MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é Signed-off-by: Anthony PERARD Message-Id: <20200603160442.3151170-1-anthony.perard@citrix.com> Signed-off-by: Paolo Bonzini --- accel/xen/xen-all.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'accel/xen') diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index f3edc65ec9..0c24d4b191 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -137,12 +137,12 @@ static void xen_change_state_handler(void *opaque, int running, static bool xen_get_igd_gfx_passthru(Object *obj, Error **errp) { - return has_igd_gfx_passthru; + return xen_igd_gfx_pt_enabled(); } static void xen_set_igd_gfx_passthru(Object *obj, bool value, Error **errp) { - has_igd_gfx_passthru = value; + xen_igd_gfx_pt_set(value, errp); } static void xen_setup_post(MachineState *ms, AccelState *accel) -- cgit v1.2.3