netdev option in new qemu is mutually exclusive with vlan.
Only pass vlan if netdev option is missing.

Signed-off-by: Michael S. Tsirkin <[email protected]>

---

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index bdc9aab..7e76ed5 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -235,9 +235,10 @@ class VM:
             return cmd
 
         def add_nic(help, vlan, model=None, mac=None, netdev_id=None):
-            cmd = " -net nic,vlan=%d" % vlan
             if has_option(help, "netdev"):
-                cmd +=",netdev=%s" % netdev_id
+                cmd = " -net nic,netdev=%s" % netdev_id
+            else:
+                cmd = " -net nic,vlan=%d" % vlan
             if model: cmd += ",model=%s" % model
             if mac: cmd += ",macaddr='%s'" % mac
             return cmd
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to