From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQ8pI-0001oX-Iq for qemu-devel@nongnu.org; Thu, 21 Jul 2016 03:55:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQ8pC-0002Y8-LL for qemu-devel@nongnu.org; Thu, 21 Jul 2016 03:55:23 -0400 Received: from mx4-phx2.redhat.com ([209.132.183.25]:35755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQ8pC-0002Xu-Cy for qemu-devel@nongnu.org; Thu, 21 Jul 2016 03:55:18 -0400 Date: Thu, 21 Jul 2016 03:55:13 -0400 (EDT) From: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Message-ID: <1666737490.6954582.1469087713405.JavaMail.zimbra@redhat.com> In-Reply-To: <20160720163556-mutt-send-email-mst@kernel.org> References: <20160706184721.2007-1-marcandre.lureau@redhat.com> <20160706184721.2007-18-marcandre.lureau@redhat.com> <20160720163556-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 17/28] get_vhost_net() should be != null after vhost_user_init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: marcandre lureau , qemu-devel@nongnu.org, mukawa@igel.co.jp, yuanhan liu , victork@redhat.com, jonshin@cisco.com Hi ----- Original Message ----- > On Wed, Jul 06, 2016 at 08:47:10PM +0200, marcandre.lureau@redhat.com wro= te: > > From: Marc-Andr=C3=A9 Lureau > >=20 > > Signed-off-by: Marc-Andr=C3=A9 Lureau > > --- > > hw/net/vhost_net.c | 1 + > > net/vhost-user.c | 2 ++ > > 2 files changed, 3 insertions(+) > >=20 > > 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 =3D vhost_user_get_vhost_net(nc); > > + assert(vhost_net !=3D 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, > > =20 > > qemu_chr_add_handlers(chr, NULL, NULL, net_vhost_user_event, > > nc[0].name); > > =20 > > + assert(s->vhost_net !=3D NULL); > > + > > return 0; > > } > >=20 >=20 > I prefer just assert(s->vhost_net) please without !=3D NULL. ok (hopefully I didn't forget any) >=20 > =20 > > -- > > 2.9.0 >=20