diff options
author | Anton Nefedov <anton.nefedov@virtuozzo.com> | 2017-07-06 15:08:49 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-07-14 11:04:33 +0200 |
commit | 81517ba37a6cec59f92396b4722861868eb0a500 (patch) | |
tree | debc47fba5f9718bc490176419076212e7dc1b57 /tests | |
parent | 313e45b5fe45542602bfa801db7a13d485c29b04 (diff) |
char: add backend hotswap handler
Frontends should have an interface to setup the handler of a backend change.
The interface will be used in the next commits
Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1499342940-56739-3-git-send-email-anton.nefedov@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-char.c | 14 | ||||
-rw-r--r-- | tests/vhost-user-test.c | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/tests/test-char.c b/tests/test-char.c index b962063e56..38aaa270ab 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -178,6 +178,7 @@ static void char_mux_test(void) fe_can_read, fe_read, fe_event, + NULL, &h1, NULL, true); @@ -186,6 +187,7 @@ static void char_mux_test(void) fe_can_read, fe_read, fe_event, + NULL, &h2, NULL, true); qemu_chr_fe_take_focus(&chr_be2); @@ -209,7 +211,8 @@ static void char_mux_test(void) h1.read_count = 0; /* remove first handler */ - qemu_chr_fe_set_handlers(&chr_be1, NULL, NULL, NULL, NULL, NULL, true); + qemu_chr_fe_set_handlers(&chr_be1, NULL, NULL, NULL, NULL, + NULL, NULL, true); qemu_chr_be_write(base, (void *)"hello", 6); g_assert_cmpint(h1.read_count, ==, 0); g_assert_cmpint(h2.read_count, ==, 0); @@ -307,13 +310,13 @@ static void char_socket_test(void) qemu_chr_fe_init(&be, chr, &error_abort); qemu_chr_fe_set_handlers(&be, socket_can_read, socket_read, - NULL, &d, NULL, true); + NULL, NULL, &d, NULL, true); chr_client = qemu_chr_new("client", tmp); qemu_chr_fe_init(&client_be, chr_client, &error_abort); qemu_chr_fe_set_handlers(&client_be, socket_can_read_hello, socket_read_hello, - NULL, &d, NULL, true); + NULL, NULL, &d, NULL, true); g_free(tmp); d.conn_expected = true; @@ -383,6 +386,7 @@ static void char_pipe_test(void) fe_can_read, fe_read, fe_event, + NULL, &fe, NULL, true); @@ -431,7 +435,7 @@ static void char_udp_test(void) d.chr = chr; qemu_chr_fe_init(&be, chr, &error_abort); qemu_chr_fe_set_handlers(&be, socket_can_read_hello, socket_read_hello, - NULL, &d, NULL, true); + NULL, NULL, &d, NULL, true); ret = qemu_chr_write_all(chr, (uint8_t *)"hello", 5); g_assert_cmpint(ret, ==, 5); @@ -523,6 +527,7 @@ static void char_file_test(void) fe_can_read, fe_read, fe_event, + NULL, &fe, NULL, true); g_assert_cmpint(fe.last_event, !=, CHR_EVENT_BREAK); @@ -583,6 +588,7 @@ static void char_null_test(void) fe_can_read, fe_read, fe_event, + NULL, NULL, NULL, true); ret = qemu_chr_fe_write(&be, (void *)"buf", 4); diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index b3cc045765..d4da09f147 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -464,7 +464,7 @@ static void test_server_create_chr(TestServer *server, const gchar *opt) qemu_chr_fe_init(&server->chr, chr, &error_abort); qemu_chr_fe_set_handlers(&server->chr, chr_can_read, chr_read, - chr_event, server, NULL, true); + chr_event, NULL, server, NULL, true); } static void test_server_listen(TestServer *server) |