From patchwork Wed Sep 9 18:12:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 46437 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n89IFspA019215 for ; Wed, 9 Sep 2009 18:15:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753997AbZIISPs (ORCPT ); Wed, 9 Sep 2009 14:15:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753989AbZIISPr (ORCPT ); Wed, 9 Sep 2009 14:15:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4628 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974AbZIISPp (ORCPT ); Wed, 9 Sep 2009 14:15:45 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n89IFmYU019943; Wed, 9 Sep 2009 14:15:48 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n89IFlfZ015420; Wed, 9 Sep 2009 14:15:47 -0400 Received: from localhost.localdomain (dhcp-1-188.tlv.redhat.com [10.35.1.188]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n89IFNFc012008; Wed, 9 Sep 2009 14:15:46 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [PATCH 17/19] KVM test: kvm_vm.py: add macaddr= to command line only if a MAC address is given Date: Wed, 9 Sep 2009 21:12:10 +0300 Message-Id: <1252519932-30733-17-git-send-email-mgoldish@redhat.com> In-Reply-To: <1252519932-30733-16-git-send-email-mgoldish@redhat.com> References: <1252519932-30733-1-git-send-email-mgoldish@redhat.com> <1252519932-30733-2-git-send-email-mgoldish@redhat.com> <1252519932-30733-3-git-send-email-mgoldish@redhat.com> <1252519932-30733-4-git-send-email-mgoldish@redhat.com> <1252519932-30733-5-git-send-email-mgoldish@redhat.com> <1252519932-30733-6-git-send-email-mgoldish@redhat.com> <1252519932-30733-7-git-send-email-mgoldish@redhat.com> <1252519932-30733-8-git-send-email-mgoldish@redhat.com> <1252519932-30733-9-git-send-email-mgoldish@redhat.com> <1252519932-30733-10-git-send-email-mgoldish@redhat.com> <1252519932-30733-11-git-send-email-mgoldish@redhat.com> <1252519932-30733-12-git-send-email-mgoldish@redhat.com> <1252519932-30733-13-git-send-email-mgoldish@redhat.com> <1252519932-30733-14-git-send-email-mgoldish@redhat.com> <1252519932-30733-15-git-send-email-mgoldish@redhat.com> <1252519932-30733-16-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org (Avoid adding weird things like 'macaddr=None' to the command line.) Signed-off-by: Michael Goldish --- 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)