From 23802b4fe0cf5821b72aa5bc682e38c8c91bb168 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Mon, 10 Feb 2014 09:28:02 +0800 Subject: qtest: Don't segfault with invalid -qtest option This prints an error message, instead of core dump, when "-qtest" option value is invalid, e.g.: $ ./x86_64-softmmu/qemu-system-x86_64 -qtest unknown qemu-system-x86_64: Failed to initialize device for qtest: "unknown" Signed-off-by: Fam Zheng Signed-off-by: Andreas Färber --- include/sysemu/qtest.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/sysemu/qtest.h b/include/sysemu/qtest.h index 6aca8e4c1f..28f4875112 100644 --- a/include/sysemu/qtest.h +++ b/include/sysemu/qtest.h @@ -15,6 +15,7 @@ #define QTEST_H #include "qemu-common.h" +#include "qapi/error.h" extern bool qtest_allowed; @@ -26,7 +27,7 @@ static inline bool qtest_enabled(void) bool qtest_driver(void); int qtest_init_accel(void); -void qtest_init(const char *qtest_chrdev, const char *qtest_log); +void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp); static inline int qtest_available(void) { -- cgit v1.2.3-55-g7522