[PATCH 17/19] KVM test: kvm_vm.py: add macaddr= to command line only if a MAC address is given

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(Avoid adding weird things like 'macaddr=None' to the command line.)

Signed-off-by: Michael Goldish <mgoldish@xxxxxxxxxx>
---
 client/tests/kvm/kvm_vm.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index d360d8e..f728104 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -234,7 +234,8 @@ class VM:
                 qemu_cmd += ",model=%s" % nic_params.get("nic_model")
             if nic_params.has_key("address_index"):
                 mac, ip = kvm_utils.get_mac_ip_pair_from_dict(nic_params)
-                qemu_cmd += ",macaddr=%s" % mac
+                if mac:
+                    qemu_cmd += ",macaddr=%s" % mac
             # Handle the '-net tap' or '-net user' part
             mode = nic_params.get("nic_mode", "user")
             qemu_cmd += " -net %s,vlan=%d" % (mode, vlan)
-- 
1.5.4.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux