From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id F18B7C768 for ; Fri, 26 Jun 2015 03:03:30 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 25 Jun 2015 18:03:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,681,1427785200"; d="scan'208";a="514411100" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by FMSMGA003.fm.intel.com with ESMTP; 25 Jun 2015 18:03:28 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by PGSMSX108.gar.corp.intel.com (10.221.44.103) with Microsoft SMTP Server (TLS) id 14.3.224.2; Fri, 26 Jun 2015 09:03:27 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.46]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.129]) with mapi id 14.03.0224.002; Fri, 26 Jun 2015 09:03:25 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] Qemu kvm module support login parameter Thread-Index: AQHQru7qAg9Y2cgrX0KgCfwQe/IvhZ28hNvg//98d4CAAfhGgA== Date: Fri, 26 Jun 2015 01:03:25 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10E52E86@SHSMSX103.ccr.corp.intel.com> References: <1435137799-23294-1-git-send-email-yong.liu@intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E10E52433@SHSMSX103.ccr.corp.intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH] Qemu kvm module support login parameter X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2015 01:03:31 -0000 Huilong, Can you give us more information about python compatibility, our framework = should compatible with python 3.0. > -----Original Message----- > From: Xu, HuilongX > Sent: Thursday, June 25, 2015 10:57 AM > To: Liu, Yong; dts@dpdk.org > Subject: RE: [dts] [PATCH] Qemu kvm module support login parameter >=20 > Hi yong, > dts need run with python2.7. > In python2.7 used if "key" in "dict" replace if "key" in dict.keys() to > check "key" in "dict" > This function add in python from python2.3 >=20 > Thanks a lot >=20 > > -----Original Message----- > > From: Liu, Yong > > Sent: Thursday, June 25, 2015 10:51 AM > > To: Xu, HuilongX; dts@dpdk.org > > Subject: RE: [dts] [PATCH] Qemu kvm module support login parameter > > > > Huilong, > > See my comments below. > > > > > -----Original Message----- > > > From: Xu, HuilongX > > > Sent: Thursday, June 25, 2015 10:31 AM > > > To: Liu, Yong; dts@dpdk.org > > > Subject: RE: [dts] [PATCH] Qemu kvm module support login parameter > > > > > > Hi yong, > > > Would check my comments as below? > > > > > > > -----Original Message----- > > > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Yong Liu > > > > Sent: Wednesday, June 24, 2015 5:23 PM > > > > To: dts@dpdk.org > > > > Subject: [dts] [PATCH] Qemu kvm module support login parameter > > > > > > > > From: Marvin Liu > > > > > > > > Default vm username and password are the same as host. > > > > User can change the default values by login parameter. > > > > > > > > Signed-off-by: Marvin Liu > > > > > > > > diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py > > > > index d149524..36622b5 100644 > > > > --- a/framework/qemu_kvm.py > > > > +++ b/framework/qemu_kvm.py > > > > @@ -92,6 +92,10 @@ class QEMUKvm(VirtBase): > > > > # devices pass-through into vm > > > > self.pt_devices =3D [] > > > > > > > > + # default login user,password > > > > + self.username =3D dut.crb['user'] > > > > + self.password =3D dut.crb['pass'] > > > > + > > > > def set_vm_default(self): > > > > self.set_vm_name(self.vm_name) > > > > self.set_vm_enable_kvm() > > > > @@ -282,6 +286,22 @@ class QEMUKvm(VirtBase): > > > > disk_boot_line =3D '-drive file=3D%s' % options['file'= ] > > > > self.__add_boot_line(disk_boot_line) > > > > > > > > + def add_vm_login(self, **options): > > > > + """ > > > > + user: login username of virtual machine > > > > + password: login password of virtual machine > > > > + """ > > > You can used "user" in options replace check dict key is > > exist > > > > Huilong, > > All parameters in virtual machine are optional. > > We can't make sure that both "user" and "password" those two parameters > > supplied by users. > > So we need to check them and if the key existed then use the value. > > > > > > + if 'user' in options.keys(): > > > Would you used self.username =3D options['user']? > > > > + user =3D options['user'] > > > > + self.username =3D user > > > > + > > > The comments same with last coments > > > > + if 'password' in options.keys(): > > > > + password =3D options['password'] > > > > + self.password =3D password > > > > + > > > > + def get_vm_login(self): > > > > + return (self.username, self.password) > > > > + > > > > def set_vm_net(self, **options): > > > > index =3D self.find_option_index('net') > > > > if index: > > > > diff --git a/framework/virt_base.py b/framework/virt_base.py > > > > index 9a0035d..063342f 100644 > > > > --- a/framework/virt_base.py > > > > +++ b/framework/virt_base.py > > > > @@ -294,6 +294,9 @@ class VirtBase(object): > > > > crb['bypass core0'] =3D False > > > > vm_ip =3D self.get_vm_ip() > > > > crb['IP'] =3D vm_ip > > > > + username, password =3D self.get_vm_login() > > > > + crb['user'] =3D username > > > > + crb['pass'] =3D password > > > > > > > > # remove default key > > > > remove_old_rsa_key(self.host_dut.tester, crb['IP']) > > > > -- > > > > 1.9.3