diff options
author | Marc-André Lureau | 2016-07-26 23:15:13 +0200 |
---|---|---|
committer | Michael S. Tsirkin | 2016-07-28 23:33:48 +0200 |
commit | 1a5b68cee8a2b165ffd61b2e0641a4da3990f242 (patch) | |
tree | 8ffd2cf6d7e4dda9b09310953c2ee6f8fbc1d10d /net/vhost-user.c | |
parent | vhost-user: keep vhost_net after a disconnection (diff) | |
download | qemu-1a5b68cee8a2b165ffd61b2e0641a4da3990f242.tar.gz qemu-1a5b68cee8a2b165ffd61b2e0641a4da3990f242.tar.xz qemu-1a5b68cee8a2b165ffd61b2e0641a4da3990f242.zip |
vhost-user: add get_vhost_net() assertions
Add a few assertions to be more explicit about the runtime behaviour
after the previous patch: get_vhost_net() is non-null after
net_vhost_user_init().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'net/vhost-user.c')
-rw-r--r-- | net/vhost-user.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/vhost-user.c b/net/vhost-user.c index d2a984d767..39987a3c8a 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -259,6 +259,8 @@ static int net_vhost_user_init(NetClientState *peer, const char *device, qemu_chr_add_handlers(chr, NULL, NULL, net_vhost_user_event, nc[0].name); + assert(s->vhost_net); + return 0; } |