From 28a0961757fcf1354a8a8f4df9f40d75c5b633dc Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 13 Nov 2019 09:59:04 +0100 Subject: vl: merge -accel processing into configure_accelerators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The next step is to move the parsing of "-machine accel=..." into vl.c, unifying it with the configure_accelerators() function that has just been introduced. This way, we will be able to desugar it into multiple "-accel" options, without polluting accel/accel.c. The CONFIG_TCG and CONFIG_KVM symbols are not available in vl.c, but we can use accel_find instead to find their value at runtime. Once we know that the binary has one of TCG or KVM, the default accelerator can be expressed simply as "tcg:kvm", because TCG never fails to initialize. Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- include/sysemu/accel.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h index 8eb60b8..90b6213 100644 --- a/include/sysemu/accel.h +++ b/include/sysemu/accel.h @@ -66,7 +66,9 @@ typedef struct AccelClass { extern unsigned long tcg_tb_size; -void configure_accelerator(MachineState *ms, const char *progname); +AccelClass *accel_find(const char *opt_name); +int accel_init_machine(AccelClass *acc, MachineState *ms); + /* Called just before os_setup_post (ie just before drop OS privs) */ void accel_setup_post(MachineState *ms); -- cgit v1.1