Message ID | 20201125205636.3305257-5-ehabkost@redhat.com |
---|---|
State | New |
Headers | show |
Series | arch_init.c cleanup | expand |
On Wed, 25 Nov 2020 15:56:34 -0500 Eduardo Habkost <ehabkost@redhat.com> wrote: > The function can be replaced with accel_available("xen"). > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > --- > Cc: Paolo Bonzini <pbonzini@redhat.com> > Cc: qemu-devel@nongnu.org > Cc: Stefano Stabellini <sstabellini@kernel.org> > Cc: Anthony Perard <anthony.perard@citrix.com> > Cc: Paul Durrant <paul@xen.org> > Cc: xen-devel@lists.xenproject.org > Cc: Richard Henderson <richard.henderson@linaro.org> > Cc: Claudio Fontana <cfontana@suse.de> > Cc: Roman Bolshakov <r.bolshakov@yadro.com> > --- > include/sysemu/arch_init.h | 2 -- > softmmu/arch_init.c | 9 --------- > softmmu/vl.c | 6 +++--- > 3 files changed, 3 insertions(+), 14 deletions(-) Reviewed-by: Cornelia Huck <cohuck@redhat.com>
diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index b32ce1afa9..40ac8052b7 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -32,6 +32,4 @@ enum { extern const uint32_t arch_type; -int xen_available(void); - #endif diff --git a/softmmu/arch_init.c b/softmmu/arch_init.c index 79383c8db8..f4770931f5 100644 --- a/softmmu/arch_init.c +++ b/softmmu/arch_init.c @@ -49,12 +49,3 @@ int graphic_depth = 32; const uint32_t arch_type = QEMU_ARCH; - -int xen_available(void) -{ -#ifdef CONFIG_XEN - return 1; -#else - return 0; -#endif -} diff --git a/softmmu/vl.c b/softmmu/vl.c index e6e0ad5a92..74b6ebf1e4 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3667,21 +3667,21 @@ void qemu_init(int argc, char **argv, char **envp) has_defaults = 0; break; case QEMU_OPTION_xen_domid: - if (!(xen_available())) { + if (!(accel_available("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_available("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_available("xen"))) { error_report("Option not supported for this target"); exit(1); }
The function can be replaced with accel_available("xen"). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: qemu-devel@nongnu.org Cc: Stefano Stabellini <sstabellini@kernel.org> Cc: Anthony Perard <anthony.perard@citrix.com> Cc: Paul Durrant <paul@xen.org> Cc: xen-devel@lists.xenproject.org Cc: Richard Henderson <richard.henderson@linaro.org> Cc: Claudio Fontana <cfontana@suse.de> Cc: Roman Bolshakov <r.bolshakov@yadro.com> --- include/sysemu/arch_init.h | 2 -- softmmu/arch_init.c | 9 --------- softmmu/vl.c | 6 +++--- 3 files changed, 3 insertions(+), 14 deletions(-)