From bb12e761e8e7b5c3c3d77bd08de9f007727a941e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 27 Jul 2016 01:15:14 +0400 Subject: Revert "vhost-net: do not crash if backend is not present" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é 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(-) (limited to 'hw') 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 = get_vhost_net(nc); - const VhostOps *vhost_ops; + const VhostOps *vhost_ops = net->dev.vhost_ops; nc->vring_enable = enable; - if (!net) { - return 0; - } - - vhost_ops = net->dev.vhost_ops; if (vhost_ops->vhost_set_vring_enable) { return vhost_ops->vhost_set_vring_enable(&net->dev, enable); } -- cgit v1.1