Received: from eggs.gnu.org ([2001:4830:134:3::10]:56687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKxh4-0005Ma-AS for qemu-devel@nongnu.org; Wed, 06 Jul 2016 21:01:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKxh2-0006en-Dt for qemu-devel@nongnu.org; Wed, 06 Jul 2016 21:01:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKxh2-0006ei-81 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 21:01:28 -0400 From: marcandre.lureau@redhat.com Date: Thu, 7 Jul 2016 03:00:42 +0200 Message-Id: <20160707010053.28008-19-marcandre.lureau@redhat.com> In-Reply-To: <20160707010053.28008-1-marcandre.lureau@redhat.com> References: <20160707010053.28008-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 v4 18/29] 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 473e6e5..22ea653 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