From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 2BFCBC4FA for ; Thu, 25 Jun 2015 04:54:01 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 24 Jun 2015 19:54:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,674,1427785200"; d="scan'208";a="752789866" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by orsmga002.jf.intel.com with ESMTP; 24 Jun 2015 19:53:59 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 25 Jun 2015 10:51:21 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.46]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.146]) with mapi id 14.03.0224.002; Thu, 25 Jun 2015 10:51:20 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] Qemu kvm module support login parameter Thread-Index: AQHQru7qAg9Y2cgrX0KgCfwQe/IvhZ28hNvg Date: Thu, 25 Jun 2015 02:51:19 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10E52433@SHSMSX103.ccr.corp.intel.com> References: <1435137799-23294-1-git-send-email-yong.liu@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: Thu, 25 Jun 2015 02:54:01 -0000 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 >=20 > Hi yong, > Would check my comments as below? >=20 > > -----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 sup= plied 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