tests/kvm: fix -net syntax for new qemu
PATCH 1/1 tests/kvm: fix -net syntax for new qemu
netdev option in new qemu is mutually exclusive with vlan. Only pass vlan if netdev option is missing.
---
client/tests/kvm/kvm_vm.py +3 -2
@@ -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
Quoted 4 lines · Michael S. Tsirkin
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]>
This fix looks good for me.
BTW, we try to produce three kinds of cmdline, 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
If you think this is good, I'll sent a patch to upstream.
Quoted 19 lines
---
client/tests/kvm/kvm_vm.py +3
-2@@ -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
Quoted 2 lines · Michael S. Tsirkin
netdev option in new qemu is mutually exclusive with vlan. Only pass vlan if netdev option is missing.
Looks good to me, applied, thanks!
http://autotest.kernel.org/changeset/4783
Quoted 25 lines
Signed-off-by Michael S. Tsirkin <[email protected]>---
client/tests/kvm/kvm_vm.py +3
-3@@ -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
Quoted 7 lines · Amos Kong
Quoted 4 lines · Michael S. Tsirkin
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]>This fix looks good for me.
Quoted 8 lines
Reviewed-by Amos Kong <[email protected]>BTW, we try to produce three kinds of cmdline, 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=netdev1If you think this is good, I'll sent a patch to upstream.
I don't think we care about the Semi-new way.
Quoted 19 lines
Quoted 19 lines
---
client/tests/kvm/kvm_vm.py +3
-2@@ -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