[5/6] qemu: Remove vlan function arguments

Message ID eb9b1990e4ff40106857e914960846563d6674df.1529426092.git.crobinso@redhat.com
State New
Headers show
Series
  • qemu: command: Replace vlan= with netdev=
Related show

Commit Message

Cole Robinson June 19, 2018, 4:40 p.m.
They are all unused now

Signed-off-by: Cole Robinson <crobinso@redhat.com>

---
 src/qemu/qemu_command.c | 23 +++++------------------
 src/qemu/qemu_command.h |  3 ---
 src/qemu/qemu_hotplug.c |  3 +--
 3 files changed, 6 insertions(+), 23 deletions(-)

-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Patch

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index a2687c5693..f2dbb3fadd 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3353,8 +3353,7 @@  qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem)
 
 
 static char *
-qemuBuildLegacyNicStr(virDomainNetDefPtr net,
-                      int vlan ATTRIBUTE_UNUSED)
+qemuBuildLegacyNicStr(virDomainNetDefPtr net)
 {
     char *str;
     char macaddr[VIR_MAC_STRING_BUFLEN];
@@ -3374,7 +3373,6 @@  qemuBuildLegacyNicStr(virDomainNetDefPtr net,
 char *
 qemuBuildNicDevStr(virDomainDefPtr def,
                    virDomainNetDefPtr net,
-                   int vlan ATTRIBUTE_UNUSED,
                    unsigned int bootindex,
                    size_t vhostfdSize,
                    virQEMUCapsPtr qemuCaps)
@@ -3552,7 +3550,6 @@  qemuBuildNicDevStr(virDomainDefPtr def,
 char *
 qemuBuildHostNetStr(virDomainNetDefPtr net,
                     virQEMUDriverPtr driver,
-                    int vlan ATTRIBUTE_UNUSED,
                     char **tapfd,
                     size_t tapfdSize,
                     char **vhostfd,
@@ -8194,7 +8191,6 @@  qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver,
     }
 
     if (!(netdev = qemuBuildHostNetStr(net, driver,
-                                       -1,
                                        NULL, 0, NULL, 0)))
         goto error;
 
@@ -8210,7 +8206,7 @@  qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver,
     virCommandAddArg(cmd, netdev);
     VIR_FREE(netdev);
 
-    if (!(nic = qemuBuildNicDevStr(def, net, -1, bootindex,
+    if (!(nic = qemuBuildNicDevStr(def, net, bootindex,
                                    queues, qemuCaps))) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        "%s", _("Error generating NIC -device string"));
@@ -8239,7 +8235,6 @@  qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
                               virDomainDefPtr def,
                               virDomainNetDefPtr net,
                               virQEMUCapsPtr qemuCaps,
-                              int vlan,
                               unsigned int bootindex,
                               virNetDevVPortProfileOp vmop,
                               bool standalone,
@@ -8486,7 +8481,6 @@  qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
     }
 
     if (!(host = qemuBuildHostNetStr(net, driver,
-                                     vlan,
                                      tapfdName, tapfdSize,
                                      vhostfdName, vhostfdSize)))
         goto cleanup;
@@ -8499,12 +8493,12 @@  qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
      *   New way: -netdev type=tap,id=netdev1 -device e1000,id=netdev1
      */
     if (qemuDomainSupportsNicdev(def, net)) {
-        if (!(nic = qemuBuildNicDevStr(def, net, vlan, bootindex,
+        if (!(nic = qemuBuildNicDevStr(def, net, bootindex,
                                        vhostfdSize, qemuCaps)))
             goto cleanup;
         virCommandAddArgList(cmd, "-device", nic, NULL);
     } else {
-        if (!(nic = qemuBuildLegacyNicStr(net, vlan)))
+        if (!(nic = qemuBuildLegacyNicStr(net)))
             goto cleanup;
         virCommandAddArgList(cmd, "-net", nic, NULL);
     }
@@ -8577,16 +8571,9 @@  qemuBuildNetCommandLine(virQEMUDriverPtr driver,
 
         for (i = 0; i < def->nnets; i++) {
             virDomainNetDefPtr net = def->nets[i];
-            int vlan;
-
-            /* VLANs are not used with -netdev and -device, so don't record them */
-            if (qemuDomainSupportsNicdev(def, net))
-                vlan = -1;
-            else
-                vlan = i;
 
             if (qemuBuildInterfaceCommandLine(driver, logManager, cmd, def, net,
-                                              qemuCaps, vlan, bootNet, vmop,
+                                              qemuCaps, bootNet, vmop,
                                               standalone, nnicindexes,
                                               nicindexes,
                                               chardevStdioLogd) < 0)
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 0bcbf3018b..c78282eb09 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -83,10 +83,8 @@  qemuBuildChrDeviceStr(char **deviceStr,
                       virDomainChrDefPtr chr,
                       virQEMUCapsPtr qemuCaps);
 
-/* With vlan == -1, use netdev syntax, else old hostnet */
 char *qemuBuildHostNetStr(virDomainNetDefPtr net,
                           virQEMUDriverPtr driver,
-                          int vlan,
                           char **tapfd,
                           size_t tapfdSize,
                           char **vhostfd,
@@ -95,7 +93,6 @@  char *qemuBuildHostNetStr(virDomainNetDefPtr net,
 /* Current, best practice */
 char *qemuBuildNicDevStr(virDomainDefPtr def,
                          virDomainNetDefPtr net,
-                         int vlan,
                          unsigned int bootindex,
                          size_t vhostfdSize,
                          virQEMUCapsPtr qemuCaps);
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 7c0c366b99..7a1bbc7c8c 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -994,7 +994,6 @@  qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
     }
 
     if (!(netstr = qemuBuildHostNetStr(net, driver,
-                                       -1,
                                        tapfdName, tapfdSize,
                                        vhostfdName, vhostfdSize)))
         goto cleanup;
@@ -1027,7 +1026,7 @@  qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
     for (i = 0; i < vhostfdSize; i++)
         VIR_FORCE_CLOSE(vhostfd[i]);
 
-    if (!(nicstr = qemuBuildNicDevStr(vm->def, net, -1, 0,
+    if (!(nicstr = qemuBuildNicDevStr(vm->def, net, 0,
                                       queueSize, priv->qemuCaps)))
         goto try_remove;