From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [KVM-AUTOTEST PATCH] tests/kvm: fix -net syntax for new qemu Date: Tue, 14 Sep 2010 13:55:41 +0200 Message-ID: <20100914115541.GB703@redhat.com> References: <20100913174322.GA19009@redhat.com> <20100914005557.GA4221@z> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: autotest@test.kernel.org, kvm@vger.kernel.org To: Amos Kong Return-path: Received: from mx1.redhat.com ([209.132.183.28]:31708 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752307Ab0INMBl (ORCPT ); Tue, 14 Sep 2010 08:01:41 -0400 Content-Disposition: inline In-Reply-To: <20100914005557.GA4221@z> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Sep 14, 2010 at 08:55:57AM +0800, Amos Kong wrote: > On Mon, Sep 13, 2010 at 07:43:22PM +0200, Michael S. Tsirkin wrote: > > netdev option in new qemu is mutually exclusive with vlan. > > Only pass vlan if netdev option is missing. > > > > Signed-off-by: Michael S. Tsirkin > > This fix looks good for me. > Reviewed-by: Amos Kong > > 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. I don't think we care about the Semi-new way. > > --- > > > > 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