diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2016-07-27 01:15:14 +0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-07-29 00:33:48 +0300 |
commit | bb12e761e8e7b5c3c3d77bd08de9f007727a941e (patch) | |
tree | 8c7f350b498f09b238899abc441a36695cd799de | |
parent | 1a5b68cee8a2b165ffd61b2e0641a4da3990f242 (diff) |
Revert "vhost-net: do not crash if backend is not present"
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 <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | hw/net/vhost_net.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 4e6495e069..54cf015dee 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); } |