[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 17/28] get_vhost_net() should be != null after vh
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v3 17/28] get_vhost_net() should be != null after vhost_user_init |
Date: |
Wed, 6 Jul 2016 20:47:10 +0200 |
From: Marc-André Lureau <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/net/vhost_net.c | 1 +
net/vhost-user.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index f1dd367..22ea653 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -417,6 +417,7 @@ VHostNetState *get_vhost_net(NetClientState *nc)
break;
case NET_CLIENT_OPTIONS_KIND_VHOST_USER:
vhost_net = vhost_user_get_vhost_net(nc);
+ assert(vhost_net != NULL);
break;
default:
break;
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 9ad7bcc..c9a5ed7 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -255,6 +255,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 != NULL);
+
return 0;
}
--
2.9.0
- Re: [Qemu-devel] [PATCH v3 10/28] vhost: change some assert() for error_report() or silent fail, (continued)
[Qemu-devel] [PATCH v3 11/28] vhost: use error_report() instead of fprintf(stderr, ...), marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 12/28] vhost-user: check qemu_chr_fe_set_msgfds() return value, marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 13/28] vhost-user: check vhost_user_{read, write}() return value, marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 14/28] qemu-char: check socket is actually connected, marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 15/28] vhost-user: keep vhost_net after a disconnection, marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 16/28] Revert "vhost-net: do not crash if backend is not present", marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 17/28] get_vhost_net() should be != null after vhost_user_init,
marcandre . lureau <=
[Qemu-devel] [PATCH v3 18/28] vhost-net: success if backend has no ops->vhost_migration_done, marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 19/28] vhost: add assert() to check runtime behaviour, marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 20/28] char: add chr_wait_connected callback, marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 21/28] char: add and use tcp_chr_wait_connected, marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 22/28] vhost-user: wait until backend init is completed, marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 23/28] tests: plug some leaks in virtio-net-test, marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 25/28] tests: add /vhost-user/connect-fail test, marcandre . lureau, 2016/07/06
[Qemu-devel] [PATCH v3 24/28] tests: fix vhost-user-test leak, marcandre . lureau, 2016/07/06