From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSyIF-0006KI-C7 for qemu-devel@nongnu.org; Thu, 28 Jul 2016 23:17:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSyI9-00038M-CL for qemu-devel@nongnu.org; Thu, 28 Jul 2016 23:16:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSyI9-00038I-6x for qemu-devel@nongnu.org; Thu, 28 Jul 2016 23:16:53 -0400 Date: Fri, 29 Jul 2016 06:16:49 +0300 From: "Michael S. Tsirkin" Message-ID: <1469762011-7902-31-git-send-email-mst@redhat.com> References: <1469762011-7902-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1469762011-7902-1-git-send-email-mst@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 30/41] 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: Peter Maydell , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Jason Wang From: Marc-Andr=E9 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=E9 Lureau Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 MST