@@ -847,7 +847,7 @@ done:
return 0;
}
-static int virtio_net__init_one(struct virtio_net_params *params, bool suppress_compat)
+static int virtio_net__init_one(struct virtio_net_params *params)
{
enum virtio_trans trans = params->kvm->cfg.virtio_transport;
struct net_dev *ndev;
@@ -913,7 +913,7 @@ static int virtio_net__init_one(struct virtio_net_params *params, bool suppress_
if (params->vhost)
virtio_net__vhost_init(params->kvm, ndev);
- if (compat_id == -1 && !suppress_compat)
+ if (compat_id == -1)
compat_id = virtio_compat_add_message("virtio-net", "CONFIG_VIRTIO_NET");
return 0;
@@ -925,7 +925,7 @@ int virtio_net__init(struct kvm *kvm)
for (i = 0; i < kvm->cfg.num_net_devices; i++) {
kvm->cfg.net_params[i].kvm = kvm;
- r = virtio_net__init_one(&kvm->cfg.net_params[i], false);
+ r = virtio_net__init_one(&kvm->cfg.net_params[i]);
if (r < 0)
goto cleanup;
}
@@ -943,7 +943,7 @@ int virtio_net__init(struct kvm *kvm)
str_to_mac(kvm->cfg.guest_mac, net_params.guest_mac);
str_to_mac(kvm->cfg.host_mac, net_params.host_mac);
- r = virtio_net__init_one(&net_params, true);
+ r = virtio_net__init_one(&net_params);
if (r < 0)
goto cleanup;
}
This reverts commit 15757e8e6441d83757c39046a6cdd3e4d74200ce. Turns out there's a way to disable the default virtio-net device: pass --network mode=none when running a VM. Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> --- virtio/net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)