[PATCH kvmtool 1/3] Revert "virtio-net: Don't print the compat warning for the default device"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 virtio/net.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/virtio/net.c b/virtio/net.c
index 77f7c9a7a788..f09dd0a48b53 100644
--- a/virtio/net.c
+++ b/virtio/net.c
@@ -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;
 	}
-- 
2.42.0




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux