aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-02-15 22:25:50 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2018-03-26 14:37:13 +0200
commit642e065a15de6c22d9830372f7ae5164505f21c7 (patch)
treeabbdae599b03b8798eabb18285e083e1c211b6a4 /tests
parent6ff8d9b03af289153cb88c9ef84ae9a76b888d88 (diff)
downloadqemu-642e065a15de6c22d9830372f7ae5164505f21c7.zip
qemu-642e065a15de6c22d9830372f7ae5164505f21c7.tar.gz
qemu-642e065a15de6c22d9830372f7ae5164505f21c7.tar.bz2
vhost-user-test: do not hang if chardev creation failed
Before the chardev name fix, the following error may happen: "attempt to add duplicate property 'chr-test' to object (type 'container')", due to races. Sadly, error_vprintf() uses g_test_message(), so you have to use read the cryptic --debug-log to see it. Later, it would make sense to use g_critical() instead, and catch errors with g_test_expect_message() (in glib 2.34). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180215212552.26997-5-marcandre.lureau@redhat.com> Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/vhost-user-test.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 22e9202..f87afee 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -494,6 +494,7 @@ static void test_server_create_chr(TestServer *server, const gchar *opt)
chr = qemu_chr_new(server->chr_name, chr_path);
g_free(chr_path);
+ g_assert_nonnull(chr);
qemu_chr_fe_init(&server->chr, chr, &error_abort);
qemu_chr_fe_set_handlers(&server->chr, chr_can_read, chr_read,
chr_event, NULL, server, NULL, true);