[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 07/16] chardev: ensure qemu_chr_parse_compat repo
From: |
Daniel P . Berrangé |
Subject: |
[Qemu-devel] [PATCH v2 07/16] chardev: ensure qemu_chr_parse_compat reports missing driver error |
Date: |
Wed, 23 Jan 2019 17:27:31 +0000 |
If no valid char driver was identified the qemu_chr_parse_compat method
was silent, leaving callers no clue what failed.
Signed-off-by: Daniel P. Berrangé <address@hidden>
---
chardev/char.c | 2 ++
tests/test-char.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/chardev/char.c b/chardev/char.c
index ccba36bafb..b99f3692f7 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -490,6 +490,8 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const
char *filename,
return opts;
}
+ error_report("'%s' is not a valid char driver", filename);
+
fail:
qemu_opts_del(opts);
return NULL;
diff --git a/tests/test-char.c b/tests/test-char.c
index 19c3efad72..a93908f044 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -856,9 +856,10 @@ static void char_null_test(void)
static void char_invalid_test(void)
{
Chardev *chr;
-
+ setenv("QTEST_SILENT_ERRORS", "1", 1);
chr = qemu_chr_new("label-invalid", "invalid");
g_assert_null(chr);
+ unsetenv("QTEST_SILENT_ERRORS");
}
static int chardev_change(void *opaque)
--
2.20.1
- [Qemu-devel] [PATCH v2 00/16] chardev: refactoring & many bugfixes related tcp_chr_wait_connected, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 01/16] io: store reference to thread information in the QIOTask struct, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 02/16] io: add qio_task_wait_thread to join with a background thread, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 03/16] chardev: fix validation of options for QMP created chardevs, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 04/16] chardev: forbid 'reconnect' option with server sockets, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 05/16] chardev: forbid 'wait' option with client sockets, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 06/16] chardev: remove many local variables in qemu_chr_parse_socket, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 12/16] chardev: honour the reconnect setting in tcp_chr_wait_connected, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 07/16] chardev: ensure qemu_chr_parse_compat reports missing driver error,
Daniel P . Berrangé <=
- [Qemu-devel] [PATCH v2 09/16] chardev: split tcp_chr_wait_connected into two methods, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 08/16] chardev: remove unused 'sioc' variable & cleanup paths, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 10/16] chardev: split up qmp_chardev_open_socket connection code, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 11/16] chardev: use a state machine for socket connection state, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 13/16] chardev: disallow TLS/telnet/websocket with tcp_chr_wait_connected, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 14/16] chardev: fix race with client connections in tcp_chr_wait_connected, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 15/16] tests: expand coverage of socket chardev test, Daniel P . Berrangé, 2019/01/23
- [Qemu-devel] [PATCH v2 16/16] chardev: ensure termios is fully initialized, Daniel P . Berrangé, 2019/01/23