Received: from eggs.gnu.org ([2001:4830:134:3::10]:37315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKrrZ-0001Bq-LB for qemu-devel@nongnu.org; Wed, 06 Jul 2016 14:48:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKrrY-0000Un-Ka for qemu-devel@nongnu.org; Wed, 06 Jul 2016 14:47:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKrrY-0000Ui-F5 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 14:47:56 -0400 From: marcandre.lureau@redhat.com Date: Wed, 6 Jul 2016 20:47:09 +0200 Message-Id: <20160706184721.2007-17-marcandre.lureau@redhat.com> In-Reply-To: <20160706184721.2007-1-marcandre.lureau@redhat.com> References: <20160706184721.2007-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v3 16/28] Revert "vhost-net: do not crash if backend is not present" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mukawa@igel.co.jp, yuanhan.liu@linux.intel.com, victork@redhat.com, jonshin@cisco.com, mst@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau Now that get_vhost_net() returns non-null after a successful vhost_net_init(), we no longer need to check this case. This reverts commit ecd34898596c60f79886061618dd7e01001113ad. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/net/vhost_net.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 08c7d1e..f1dd367 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -428,15 +428,10 @@ VHostNetState *get_vhost_net(NetClientState *nc) int vhost_set_vring_enable(NetClientState *nc, int enable) { VHostNetState *net =3D get_vhost_net(nc); - const VhostOps *vhost_ops; + const VhostOps *vhost_ops =3D net->dev.vhost_ops; =20 nc->vring_enable =3D enable; =20 - if (!net) { - return 0; - } - - vhost_ops =3D net->dev.vhost_ops; if (vhost_ops->vhost_set_vring_enable) { return vhost_ops->vhost_set_vring_enable(&net->dev, enable); } --=20 2.9.0