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>
This commit is contained in:
parent
1a5b68cee8
commit
bb12e761e8
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user