diff options
Diffstat (limited to 'tests/qtest/libqtest.c')
-rw-r--r-- | tests/qtest/libqtest.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 08929f5..b9ff290 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -870,9 +870,14 @@ char *qtest_hmp(QTestState *s, const char *fmt, ...) const char *qtest_get_arch(void) { const char *qemu = qtest_qemu_binary(); - const char *end = strrchr(qemu, '/'); + const char *end = strrchr(qemu, '-'); - return end + strlen("/qemu-system-"); + if (!end) { + fprintf(stderr, "Can't determine architecture from binary name.\n"); + abort(); + } + + return end + 1; } bool qtest_get_irq(QTestState *s, int num) |