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 291041B00B for ; Tue, 9 Jan 2018 07:54:43 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2018 22:54:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,334,1511856000"; d="scan'208";a="193468313" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga006.fm.intel.com with ESMTP; 08 Jan 2018 22:54:42 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Jan 2018 22:54:42 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.218]) with mapi id 14.03.0319.002; Tue, 9 Jan 2018 14:54:39 +0800 From: "Liu, Yong" To: Herbert Guan , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] framework: add virt_type option for virt type(kvm/libvirt) selection Thread-Index: AQHTiQ9HC7MG0uc5M0qTUrUfak2+MqNrGUhw Date: Tue, 9 Jan 2018 06:54:39 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62F42AB7@SHSMSX103.ccr.corp.intel.com> References: <1515477655-19201-1-git-send-email-herbert.guan@arm.com> In-Reply-To: <1515477655-19201-1-git-send-email-herbert.guan@arm.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzJlMDhiMDAtYTkxNi00OTY3LTgzZTktZTlmNjlhZTgyOTBhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJROHNGQ0FJMkZZcmM4UVpQYnNwM1hTNWtmRUI4TmlrcElKZUdYVVwvWlBWTlBUb1p4R0VUYzlkTWZOakxraVhGcCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action 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] framework: add virt_type option for virt type(kvm/libvirt) selection 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: Tue, 09 Jan 2018 06:54:44 -0000 Hi Herbert, I think argument "virt_type" is not needed for suite level configuration. T= here will be one possible scenario like libvirt and qemu VMs enabled in one= suite.=20 Please see my inline comment.=20 Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Herbert Guan > Sent: Tuesday, January 09, 2018 2:01 PM > To: dts@dpdk.org > Cc: Herbert Guan > Subject: [dts] [PATCH] framework: add virt_type option for virt > type(kvm/libvirt) selection >=20 > Allow users to use test config file to specify virt type(kvm, libvirt, et= c) > by > 'virt_type' option. If not specified in config file, the default > virt_type > is kvm (qemu_kvm). >=20 >=20 > Signed-off-by: Herbert Guan > --- > framework/virt_base.py | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) >=20 > diff --git a/framework/virt_base.py b/framework/virt_base.py > index 1838ca1..cd6dc0c 100644 > --- a/framework/virt_base.py > +++ b/framework/virt_base.py > @@ -98,13 +98,22 @@ class VirtBase(object): > """ > Get the virtual type, such as KVM, XEN or LIBVIRT. > """ > - NotImplemented > + conf =3D VirtConf(CONFIG_ROOT_PATH + os.sep + self.suite + '.cfg= ') > + conf.load_virt_config(self.vm_name) > + local_conf =3D conf.get_virt_config() > + for param in local_conf: > + if 'virt_type' in param.keys(): > + return param['virt_type'][0]['virt_type'] > + # if virt_type is not existing in config file, return 'KVM' by > default > + return 'KVM' > + Virt_type has been specified when instantiating virtual machine object, so = can initialize virt_type variable in init function of VM object. >=20 > def has_virtual_ability(self): > """ > Check if the host have the ability of virtualization. > """ > - NotImplemented > + # Return True for non-derived virt_base object. > + return True >=20 > def enable_virtual_ability(self): > """ > @@ -140,6 +149,9 @@ class VirtBase(object): > if 'cpu' in param.keys(): > self.__save_local_config('cpu', param['cpu']) > continue > + if 'virt_type' in param.keys(): > + # param 'virt_type' is for virt_base only > + continue > # save local configurations > for key in param.keys(): > self.__save_local_config(key, param[key]) > -- > 1.8.3.1