diff mbox

[2/2] vhost-user: delete chardev on cleanup

Message ID 1459957128-17685-3-git-send-email-marcandre.lureau@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Marc-André Lureau April 6, 2016, 3:38 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Remove the chardev implicitely when cleaning up the netdev. This
prevents from reusing the chardev since it would be in an incorrect
state with the slave.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 net/vhost-user.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/net/vhost-user.c b/net/vhost-user.c
index 29fe097..2d7271a 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -144,6 +144,7 @@  static void vhost_user_cleanup(NetClientState *nc)
     qemu_purge_queued_packets(nc);
 
     qemu_chr_fe_release(s->chr);
+    qemu_chr_delete(s->chr);
 }
 
 static bool vhost_user_has_vnet_hdr(NetClientState *nc)