Commit e0b283e7 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Michael S. Tsirkin
Browse files

vhost-user: delete chardev on cleanup

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

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1256618



Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
parent d56ec1e9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -151,7 +151,10 @@ static void vhost_user_cleanup(NetClientState *nc)
        s->vhost_net = NULL;
    }
    if (nc->queue_index == 0) {
        Chardev *chr = qemu_chr_fe_get_driver(&s->chr);

        qemu_chr_fe_deinit(&s->chr);
        qemu_chr_delete(chr);
    }

    qemu_purge_queued_packets(nc);