summaryrefslogtreecommitdiffstats
path: root/tests/vhost-user-test.c
diff options
context:
space:
mode:
authorMarc-André Lureau2017-01-26 21:49:13 +0100
committerMarc-André Lureau2017-06-02 09:33:53 +0200
commit1ce2610c106d925387669b3133fc18ea986f0476 (patch)
treebd08c41941ea2235cabde4c02739f6ca52ff07d7 /tests/vhost-user-test.c
parentchar: rename functions that are not part of fe (diff)
downloadqemu-1ce2610c106d925387669b3133fc18ea986f0476.tar.gz
qemu-1ce2610c106d925387669b3133fc18ea986f0476.tar.xz
qemu-1ce2610c106d925387669b3133fc18ea986f0476.zip
char: make chr_fe_deinit() optionaly delete backend
This simplifies removing a backend for a frontend user (no need to retrieve the associated driver and separate delete call etc). NB: many frontends have questionable handling of ending a chardev. They should probably delete the backend to prevent broken reusage. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'tests/vhost-user-test.c')
-rw-r--r--tests/vhost-user-test.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 4ca11ae28d..b3cc045765 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -488,10 +488,8 @@ static inline void test_server_connect(TestServer *server)
static gboolean _test_server_free(TestServer *server)
{
int i;
- Chardev *chr = qemu_chr_fe_get_driver(&server->chr);
- qemu_chr_fe_deinit(&server->chr);
- object_unparent(OBJECT(chr));
+ qemu_chr_fe_deinit(&server->chr, true);
for (i = 0; i < server->fds_num; i++) {
close(server->fds[i]);