]> Git Repo - qemu.git/commitdiff
Revert "vhost-net: do not crash if backend is not present"
authorMarc-André Lureau <[email protected]>
Tue, 26 Jul 2016 21:15:14 +0000 (01:15 +0400)
committerMichael S. Tsirkin <[email protected]>
Thu, 28 Jul 2016 21:33:48 +0000 (00:33 +0300)
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 <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
hw/net/vhost_net.c

index 4e6495e0699ac2c2798f09e3aa499a6a7384cc93..54cf015dee00006fc65d8592107a095b785ce26d 100644 (file)
@@ -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);
     }
This page took 0.028435 seconds and 4 git commands to generate.