From nobody Wed May 14 12:38:33 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1522415784489411.5498936409656; Fri, 30 Mar 2018 06:16:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB2B77F74F; Fri, 30 Mar 2018 13:16:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71B0D5D6A8; Fri, 30 Mar 2018 13:16:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 013DD180BAD7; Fri, 30 Mar 2018 13:16:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2UDGDC4010433 for ; Fri, 30 Mar 2018 09:16:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3B3216352D; Fri, 30 Mar 2018 13:16:13 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5ADE63537 for ; Fri, 30 Mar 2018 13:16:12 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Fri, 30 Mar 2018 15:15:25 +0200 Message-Id: <16a016d9ec61c350bb4c6a7580cd7caa1a078d81.1522415592.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/44] Remove qemuDomainSupportsNetdev X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 30 Mar 2018 13:16:23 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Now that we assume QEMU_CAPS_NETDEV, the only thing left to check is whether we need to use the legacy -net syntax because of a non-conforming armchitecture. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 20 +++++--------------- src/qemu/qemu_domain.c | 10 ---------- src/qemu/qemu_domain.h | 4 ---- src/qemu/qemu_hotplug.c | 2 +- src/qemu/qemu_interface.c | 2 +- 5 files changed, 7 insertions(+), 31 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 3241b1cf5..3dda9156d 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8222,7 +8222,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver, unsigned int queues =3D net->driver.virtio.queues; char *nic =3D NULL; =20 - if (!qemuDomainSupportsNetdev(def, qemuCaps, net)) { + if (!qemuDomainSupportsNicdev(def, net)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Netdev support unavailable")); goto error; @@ -8557,23 +8557,14 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driv= er, goto cleanup; } =20 - /* Possible combinations: - * - * 1. Old way: -net nic,model=3De1000,vlan=3D1 -net tap,vlan=3D1 - * 2. Semi-new: -device e1000,vlan=3D1 -net tap,vlan=3D1 - * 3. Best way: -netdev type=3Dtap,id=3Dnetdev1 -device e1000,id=3Dn= etdev1 - * - * NB, no support for -netdev without use of -device - */ - if (qemuDomainSupportsNetdev(def, qemuCaps, net)) { + if (qemuDomainSupportsNicdev(def, net)) { if (!(host =3D qemuBuildHostNetStr(net, driver, ',', vlan, tapfdName, tapfdSize, vhostfdName, vhostfdSize))) goto cleanup; virCommandAddArgList(cmd, "-netdev", host, NULL); - } - if (qemuDomainSupportsNicdev(def, net)) { + if (!(nic =3D qemuBuildNicDevStr(def, net, vlan, bootindex, vhostfdSize, qemuCaps))) goto cleanup; @@ -8582,8 +8573,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, if (!(nic =3D qemuBuildNicStr(net, "nic,", vlan))) goto cleanup; virCommandAddArgList(cmd, "-net", nic, NULL); - } - if (!qemuDomainSupportsNetdev(def, qemuCaps, net)) { + if (!(host =3D qemuBuildHostNetStr(net, driver, ',', vlan, tapfdName, tapfdSize, @@ -8663,7 +8653,7 @@ qemuBuildNetCommandLine(virQEMUDriverPtr driver, int vlan; =20 /* VLANs are not used with -netdev, so don't record them */ - if (qemuDomainSupportsNetdev(def, qemuCaps, net)) + if (qemuDomainSupportsNicdev(def, net)) vlan =3D -1; else vlan =3D i; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e4a8c45cf..b4ce6c145 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9109,16 +9109,6 @@ qemuDomainSupportsNicdev(virDomainDefPtr def, return true; } =20 -bool -qemuDomainSupportsNetdev(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED, - virDomainNetDefPtr net) -{ - if (!qemuDomainSupportsNicdev(def, net)) - return false; - return true; -} - bool qemuDomainNetSupportsMTU(virDomainNetType type) { diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 43352412c..c01cc85e0 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -799,10 +799,6 @@ int qemuDomainRefreshVcpuHalted(virQEMUDriverPtr drive= r, bool qemuDomainSupportsNicdev(virDomainDefPtr def, virDomainNetDefPtr net); =20 -bool qemuDomainSupportsNetdev(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, - virDomainNetDefPtr net); - bool qemuDomainNetSupportsMTU(virDomainNetType type); =20 int qemuDomainSetPrivatePaths(virQEMUDriverPtr driver, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index a3e20c6e8..a70ec5b6e 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -956,7 +956,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, queueSize =3D net->driver.virtio.queues; if (!queueSize) queueSize =3D 1; - if (!qemuDomainSupportsNetdev(vm->def, priv->qemuCaps, net)) { + if (!qemuDomainSupportsNicdev(vm->def, net)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Netdev support unavailable")); goto cleanup; diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index cebb49022..24c0174bf 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -646,7 +646,7 @@ qemuInterfaceOpenVhostNet(virDomainDefPtr def, * option), don't try to open the device. */ if (!(virQEMUCapsGet(qemuCaps, QEMU_CAPS_VHOST_NET) && - qemuDomainSupportsNetdev(def, qemuCaps, net))) { + qemuDomainSupportsNicdev(def, net))) { if (net->driver.virtio.name =3D=3D VIR_DOMAIN_NET_BACKEND_TYPE_VHO= ST) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("vhost-net is not supported with " --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list