From 6773fbf8c07c58429ca876ddea760f604d0497a8 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 30 Jul 2021 11:59:40 +0100 Subject: softmmu: Use accel_find("xen") instead of xen_available() The xen_available() function is used only to produce an error for some Xen-specific command line options in QEMU binaries where Xen support was not compiled in: it just returns the value of the CONFIG_XEN define. Now that accelerators are QOM classes, we can check for "does this binary have Xen compiled in" with accel_find("xen"), and drop the xen_available() function. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20210730105947.28215-2-peter.maydell@linaro.org --- softmmu/arch_init.c | 9 --------- softmmu/vl.c | 6 +++--- 2 files changed, 3 insertions(+), 12 deletions(-) (limited to 'softmmu') diff --git a/softmmu/arch_init.c b/softmmu/arch_init.c index 6ff9f30..3f4d7c1 100644 --- a/softmmu/arch_init.c +++ b/softmmu/arch_init.c @@ -96,12 +96,3 @@ int kvm_available(void) return 0; #endif } - -int xen_available(void) -{ -#ifdef CONFIG_XEN - return 1; -#else - return 0; -#endif -} diff --git a/softmmu/vl.c b/softmmu/vl.c index 5ca11e7..82d574f 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3448,21 +3448,21 @@ void qemu_init(int argc, char **argv, char **envp) has_defaults = 0; break; case QEMU_OPTION_xen_domid: - if (!(xen_available())) { + if (!(accel_find("xen"))) { error_report("Option not supported for this target"); exit(1); } xen_domid = atoi(optarg); break; case QEMU_OPTION_xen_attach: - if (!(xen_available())) { + if (!(accel_find("xen"))) { error_report("Option not supported for this target"); exit(1); } xen_mode = XEN_ATTACH; break; case QEMU_OPTION_xen_domid_restrict: - if (!(xen_available())) { + if (!(accel_find("xen"))) { error_report("Option not supported for this target"); exit(1); } -- cgit v1.1