From d4fce24f3a59eda081cdf2e38e7001591b95d173 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 18 Oct 2013 13:51:11 +0200 Subject: qtest: split configuration of qtest accelerator and chardev qtest uses the icount infrastructure to implement a test-driven vm_clock. This however is not necessary when using -qtest as a "probe" together with a normal TCG-, KVM- or Xen-based virtual machine. Hence, split out the call to configure_icount into a new function that is called only for "-machine accel=qtest"; and disable those commands when running with an accelerator other than qtest. This also fixes an assertion failure with "qemu-system-x86_64 -machine accel=qtest" but no -qtest option. This is a valid case, albeit somewhat weird; nothing will happen in the VM but you'll still be able to interact with the monitor or the GUI. Now that qtest_init is not limited to an int(void) function, change global variables that are not used outside qtest_init to arguments. And finally, cleanup useless parts of include/sysemu/qtest.h. The file is not used at all for user-only emulation, and qtest is not available on Win32 due to its usage of sigwait. Reported-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin Tested-by: Michael S. Tsirkin Signed-off-by: Paolo Bonzini Signed-off-by: Michael S. Tsirkin --- include/sysemu/qtest.h | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/sysemu/qtest.h b/include/sysemu/qtest.h index 9a0c6b31c8..112a661ac4 100644 --- a/include/sysemu/qtest.h +++ b/include/sysemu/qtest.h @@ -16,38 +16,23 @@ #include "qemu-common.h" -#if !defined(CONFIG_USER_ONLY) extern bool qtest_allowed; -extern const char *qtest_chrdev; -extern const char *qtest_log; static inline bool qtest_enabled(void) { return qtest_allowed; } +int qtest_init_accel(void); +void qtest_init(const char *qtest_chrdev, const char *qtest_log); + static inline int qtest_available(void) { +#ifdef CONFIG_POSIX return 1; -} - -int qtest_init(void); #else -static inline bool qtest_enabled(void) -{ - return false; -} - -static inline int qtest_available(void) -{ - return 0; -} - -static inline int qtest_init(void) -{ return 0; -} - #endif +} #endif -- cgit v1.2.3-55-g7522