Received: from eggs.gnu.org ([2001:4830:134:3::10]:60130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS9iY-00030s-3N for qemu-devel@nongnu.org; Tue, 26 Jul 2016 17:16:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bS9iX-0002KD-3M for qemu-devel@nongnu.org; Tue, 26 Jul 2016 17:16:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS9iW-0002K7-TY for qemu-devel@nongnu.org; Tue, 26 Jul 2016 17:16:45 -0400 From: marcandre.lureau@redhat.com Date: Wed, 27 Jul 2016 01:15:14 +0400 Message-Id: <20160726211527.28510-21-marcandre.lureau@redhat.com> In-Reply-To: <20160726211527.28510-1-marcandre.lureau@redhat.com> References: <20160726211527.28510-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 v6 20/33] 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 4e6495e..54cf015 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -429,15 +429,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