Skip to content
Snippets Groups Projects
Commit 0bf62dc8 authored by Daniel P. Berrangé's avatar Daniel P. Berrangé Committed by Marc-André Lureau
Browse files

chardev: ensure qemu_chr_parse_compat reports missing driver error


If no valid char driver was identified the qemu_chr_parse_compat method
was silent, leaving callers no clue what failed.

Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190211182442.8542-8-berrange@redhat.com>
Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
parent 5981c3a2
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -932,9 +932,10 @@ static void char_null_test(void)
static void char_invalid_test(void)
{
Chardev *chr;
g_setenv("QTEST_SILENT_ERRORS", "1", 1);
chr = qemu_chr_new("label-invalid", "invalid");
g_assert_null(chr);
g_unsetenv("QTEST_SILENT_ERRORS");
}
static int chardev_change(void *opaque)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment