diff options
Diffstat (limited to 'qtest.c')
-rw-r--r-- | qtest.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -507,12 +507,18 @@ int qtest_init_accel(void) return 0; } -void qtest_init(const char *qtest_chrdev, const char *qtest_log) +void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp) { CharDriverState *chr; chr = qemu_chr_new("qtest", qtest_chrdev, NULL); + if (chr == NULL) { + error_setg(errp, "Failed to initialize device for qtest: \"%s\"", + qtest_chrdev); + return; + } + qemu_chr_add_handlers(chr, qtest_can_read, qtest_read, qtest_event, chr); qemu_chr_fe_set_echo(chr, true); |