diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2023-04-13 16:07:23 +0100 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2023-04-20 06:50:11 +0200 |
commit | 537a1388e65a784ac21eaf1639222e6332357b2f (patch) | |
tree | 1402ff4d541c9a3ce07e13b1b122b0f2ff6e9dc4 /chardev/char-file.c | |
parent | 9a29e02073e5d032e49fb3af992b6065bd2acd3c (diff) | |
download | qemu-537a1388e65a784ac21eaf1639222e6332357b2f.zip qemu-537a1388e65a784ac21eaf1639222e6332357b2f.tar.gz qemu-537a1388e65a784ac21eaf1639222e6332357b2f.tar.bz2 |
qtest: Don't assert on "-qtest chardev:myid"
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>
Diffstat (limited to 'chardev/char-file.c')
0 files changed, 0 insertions, 0 deletions