[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/23] qtest: Don't assert on "-qtest chardev:myid"
From: |
Thomas Huth |
Subject: |
[PULL 05/23] qtest: Don't assert on "-qtest chardev:myid" |
Date: |
Thu, 20 Apr 2023 12:11:58 +0200 |
From: Peter Maydell <peter.maydell@linaro.org>
If the -qtest command line argument is passed a string that says
"use this chardev for I/O", then it will assert:
$ ./build/clang/qemu-system-i386 -chardev file,path=/dev/null,id=myid -qtest
chardev:myid
Unexpected error in qtest_set_chardev() at ../../softmmu/qtest.c:1011:
qemu-system-i386: Cannot find character device 'qtest'
Aborted (core dumped)
This is because in qtest_server_init() we assume that when we create
the chardev with qemu_chr_new() it will always have the name "qtest".
This is true if qemu_chr_new() had to create a new chardev, but not
true if one already existed and is being referred to with
"chardev:myid".
Use the name of the chardev we get back from qemu_chr_new() as the
string to set the qtest 'chardev' property to, instead of hardcoding
it to "qtest".
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20230413150724.404304-2-peter.maydell@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
softmmu/qtest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/softmmu/qtest.c b/softmmu/qtest.c
index 34bd2a33a7..26852996b5 100644
--- a/softmmu/qtest.c
+++ b/softmmu/qtest.c
@@ -867,7 +867,7 @@ void qtest_server_init(const char *qtest_chrdev, const char
*qtest_log, Error **
}
qtest = object_new(TYPE_QTEST);
- object_property_set_str(qtest, "chardev", "qtest", &error_abort);
+ object_property_set_str(qtest, "chardev", chr->label, &error_abort);
if (qtest_log) {
object_property_set_str(qtest, "log", qtest_log, &error_abort);
}
--
2.31.1
- [PULL 00/23] First batch of testing and misc patches for 8.1, Thomas Huth, 2023/04/20
- [PULL 03/23] docs/cxl: Fix sentence, Thomas Huth, 2023/04/20
- [PULL 02/23] docs: Fix typo (wphx => whpx), Thomas Huth, 2023/04/20
- [PULL 01/23] hw: Add compat machines for 8.1, Thomas Huth, 2023/04/20
- [PULL 05/23] qtest: Don't assert on "-qtest chardev:myid",
Thomas Huth <=
- [PULL 06/23] chardev: Allow setting file chardev input file on the command line, Thomas Huth, 2023/04/20
- [PULL 10/23] target/i386: Set family/model/stepping of the "max" CPU according to LM bit, Thomas Huth, 2023/04/20
- [PULL 08/23] travis.yml: Add missing 'flex', 'bison' packages to 'GCC (user)' job, Thomas Huth, 2023/04/20
- [PULL 14/23] softmmu: Make qtest.c target independent, Thomas Huth, 2023/04/20
- [PULL 07/23] travis.yml: Add missing clang-10 package to the 'Clang (disable-tcg)' job, Thomas Huth, 2023/04/20
- [PULL 04/23] test: Fix test-crypto-secret when compiling without keyring support, Thomas Huth, 2023/04/20
- [PULL 13/23] include/exec: Provide the tswap() functions for target independent code, too, Thomas Huth, 2023/04/20
- [PULL 15/23] hw/display: Compile vga.c as target-independent code, Thomas Huth, 2023/04/20
- [PULL 12/23] softmmu/qtest: Move the target-specific pseries RTAS code out of qtest.c, Thomas Huth, 2023/04/20
- [PULL 17/23] hw/core: Move numa.c into the target independent source set, Thomas Huth, 2023/04/20