system/qtest: Minor include cleanups
cover system/qtest: Minor include cleanups
Add missing header and restrict to sysemu.
Philippe Mathieu-Daudé (2):
system/qtest: Include missing 'hw/core/cpu.h' header system/qtest: Restrict QTest API to system emulation
include/sysemu/qtest.h | 2 ++ system/qtest.c | 1 + 2 files changed, 3 insertions(+)
Signature · 1 line
2.41.0
PATCH 1/2 system/qtest: Include missing 'hw/core/cpu.h' header
"hw/core/cpu.h" declares 'first_cpu'. Include it to avoid when unrelated headers are refactored:
system/qtest.c:548:33: error: use of undeclared identifier 'first_cpu'
address_space_write(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED,
^--- system/qtest.c | 1 + 1 file changed, 1 insertion(+)
system/qtest.c +1 -0
@@ -21,6 +21,7 @@#include "exec/tswap.h" #include "hw/qdev-core.h" #include "hw/irq.h" +#include "hw/core/cpu.h" #include "qemu/accel.h" #include "sysemu/cpu-timers.h" #include "qemu/config-file.h"
Signature · 1 line
2.41.0
Re: [PATCH 1/2] system/qtest: Include missing 'hw/core/cpu.h' header
Quoted 17 lines · Philippe Mathieu-Daudé
"
hw/core/cpu.h" declares 'first_cpu'. Include it to avoid when unrelated headers are refactored:system/qtest.c:548:33: error: use of undeclared identifier 'first_cpu' address_space_write(first_cpu->as, addr, MEMTXATTRS_UNSPECIFIED, ^Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- system/qtest.c | 1 + 1 file changed, 1 insertion(+)system/qtest.c +0
-0
system/qtest.c line 27
Quoted 7 lines
system/qtest.c +1
-0@@ -21,6 +21,7 @@#include "exec/tswap.h" #include "hw/qdev-core.h" #include "hw/irq.h" +#include "hw/core/cpu.h" #include "qemu/accel.h" #include "sysemu/cpu-timers.h" #include "qemu/config-file.h"
PATCH 2/2 system/qtest: Restrict QTest API to system emulation
In reply to Philippe Mathieu-DaudéOutside of system emulation, only qtest_enabled() can be used.
--- include/sysemu/qtest.h | 2 ++ 1 file changed, 2 insertions(+)
include/sysemu/qtest.h +2 -0
@@ -23,6 +23,7 @@ static inline bool qtest_enabled(void)return qtest_allowed; } +#ifndef CONFIG_USER_ONLY void qtest_send_prefix (CharBackend *chr); void G_GNUC_PRINTF(2, 3) qtest_sendf(CharBackend *chr, const char *fmt, ...); void qtest_set_command_cb(bool (*pc_cb)(CharBackend *chr, gchar **words));
@@ -35,5 +36,6 @@ void qtest_server_set_send_handler(void (*send)(void *, const char *),void qtest_server_inproc_recv (void *opaque,const char *buf);int64_t qtest_get_virtual_clock (void ); +#endif #endif
Signature · 1 line
2.41.0
Re: [PATCH 2/2] system/qtest: Restrict QTest API to system emulation
Quoted 20 lines · Philippe Mathieu-Daudé
Outside of system emulation, only
qtest_enabled()can be used.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/sysemu/qtest.h | 2 ++ 1 file changed, 2 insertions(+)include/sysemu/qtest.h +1
-0@@ -23,6 +23,7 @@ static inline bool qtest_enabled(void)return qtest_allowed; } +#ifndef CONFIG_USER_ONLY void qtest_send_prefix (CharBackend *chr); void G_GNUC_PRINTF(2, 3) qtest_sendf(CharBackend *chr, const char *fmt, ...); void qtest_set_command_cb(bool (*pc_cb)(CharBackend *chr, gchar **words));
include/sysemu/qtest.h void qtest_server_set_send_handler(void (*send)(void *, const char *), · line 39
Quoted 4 lines
include/sysemu/qtest.h +1
-0@@ -35,5 +36,6 @@ void qtest_server_set_send_handler(void (*send)(void *, const char *),void qtest_server_inproc_recv (void *opaque,const char *buf);int64_t qtest_get_virtual_clock (void ); +#endif
Quoted 5 lines · Philippe Mathieu-Daudé
Add missing header and restrict to sysemu.
Philippe Mathieu-Daudé (2):
system/qtest: Include missing 'hw/core/cpu.h' header system/qtest: Restrict QTest API to system emulation
Thanks Thomas for merging these!