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án Tomko <jtomko(a)redhat.com>
---
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 05cc4903a4..4e8c4a7bd4 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -8217,7 +8217,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver,
unsigned int queues = net->driver.virtio.queues;
char *nic = NULL;
- if (!qemuDomainSupportsNetdev(def, qemuCaps, net)) {
+ if (!qemuDomainSupportsNicdev(def, net)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Netdev support unavailable"));
goto error;
@@ -8552,23 +8552,14 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
goto cleanup;
}
- /* Possible combinations:
- *
- * 1. Old way: -net nic,model=e1000,vlan=1 -net tap,vlan=1
- * 2. Semi-new: -device e1000,vlan=1 -net tap,vlan=1
- * 3. Best way: -netdev type=tap,id=netdev1 -device e1000,id=netdev1
- *
- * NB, no support for -netdev without use of -device
- */
- if (qemuDomainSupportsNetdev(def, qemuCaps, net)) {
+ if (qemuDomainSupportsNicdev(def, net)) {
if (!(host = qemuBuildHostNetStr(net, driver,
',', vlan,
tapfdName, tapfdSize,
vhostfdName, vhostfdSize)))
goto cleanup;
virCommandAddArgList(cmd, "-netdev", host, NULL);
- }
- if (qemuDomainSupportsNicdev(def, net)) {
+
if (!(nic = qemuBuildNicDevStr(def, net, vlan, bootindex,
vhostfdSize, qemuCaps)))
goto cleanup;
@@ -8577,8 +8568,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
if (!(nic = qemuBuildNicStr(net, "nic,", vlan)))
goto cleanup;
virCommandAddArgList(cmd, "-net", nic, NULL);
- }
- if (!qemuDomainSupportsNetdev(def, qemuCaps, net)) {
+
if (!(host = qemuBuildHostNetStr(net, driver,
',', vlan,
tapfdName, tapfdSize,
@@ -8658,7 +8648,7 @@ qemuBuildNetCommandLine(virQEMUDriverPtr driver,
int vlan;
/* VLANs are not used with -netdev, so don't record them */
- if (qemuDomainSupportsNetdev(def, qemuCaps, net))
+ if (qemuDomainSupportsNicdev(def, net))
vlan = -1;
else
vlan = i;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index fab1519969..796984b12d 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -9159,16 +9159,6 @@ qemuDomainSupportsNicdev(virDomainDefPtr def,
return true;
}
-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 ce8f69d336..be9aff180b 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -799,10 +799,6 @@ int qemuDomainRefreshVcpuHalted(virQEMUDriverPtr driver,
bool qemuDomainSupportsNicdev(virDomainDefPtr def,
virDomainNetDefPtr net);
-bool qemuDomainSupportsNetdev(virDomainDefPtr def,
- virQEMUCapsPtr qemuCaps,
- virDomainNetDefPtr net);
-
bool qemuDomainNetSupportsMTU(virDomainNetType type);
int qemuDomainSetPrivatePaths(virQEMUDriverPtr driver,
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index c145c42bcd..8aacd8376f 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -956,7 +956,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
queueSize = net->driver.virtio.queues;
if (!queueSize)
queueSize = 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 cebb490221..24c0174bf9 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 == VIR_DOMAIN_NET_BACKEND_TYPE_VHOST) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
"%s", _("vhost-net is not supported with
"
--
2.16.1