From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BDBB6A3160 for ; Thu, 10 Oct 2019 10:04:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A315D1C2F6; Thu, 10 Oct 2019 10:04:09 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 764AB1C1D3 for ; Thu, 10 Oct 2019 10:04:08 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Oct 2019 01:04:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,279,1566889200"; d="scan'208";a="218943189" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga004.fm.intel.com with ESMTP; 10 Oct 2019 01:04:07 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 10 Oct 2019 01:04:07 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 10 Oct 2019 01:04:07 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.166]) by SHSMSX154.ccr.corp.intel.com ([10.239.6.54]) with mapi id 14.03.0439.000; Thu, 10 Oct 2019 16:04:04 +0800 From: "Wang, Yinan" To: "Ma, LihongX" , "dts@dpdk.org" Thread-Topic: [dts][PATCH V1 2/3][migration] framework: update code support migration Thread-Index: AQHVfz6LLv51EvFHI0Cg8tX/fvM8+6dThA3w Date: Thu, 10 Oct 2019 08:04:04 +0000 Message-ID: References: <1570666746-12853-1-git-send-email-lihongx.ma@intel.com> <1570666746-12853-2-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1570666746-12853-2-git-send-email-lihongx.ma@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjczNjJjNTYtN2U3MS00OTliLWIzOGEtMmUxNDM5MTc3OTY1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoic1JvZVVMYU1xV1orVTBcL0FBYWo1ZUNDUHhJMmM2dHJ3OFJENGJIUGtXbjZONEVNSkpXbTFmMTRrRXlvT3VzVHcifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1 2/3][migration] framework: update code support migration 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Acked-by: Wang, Yinan > -----Original Message----- > From: Ma, LihongX > Sent: 2019=1B$BG/=1B(B10=1B$B7n=1B(B10=1B$BF|=1B(B 8:19 > To: dts@dpdk.org > Cc: Wang, Yinan ; Ma, LihongX > Subject: [dts][PATCH V1 2/3][migration] framework: update code support > migration >=20 > Signed-off-by: lihong > --- > framework/virt_base.py | 8 ++++++++ > framework/virt_dut.py | 12 ++++++++---- > 2 files changed, 16 insertions(+), 4 deletions(-) >=20 > diff --git a/framework/virt_base.py b/framework/virt_base.py index > 7c1e1de..6e3462c 100644 > --- a/framework/virt_base.py > +++ b/framework/virt_base.py > @@ -65,6 +65,8 @@ class VirtBase(object): > self.host_dut =3D dut > self.vm_name =3D vm_name > self.suite =3D suite_name > + # indicate whether the current vm is migration vm > + self.migration_vm =3D False >=20 > # create self used host session, need close it later > self.host_session =3D self.host_dut.new_session(self.vm_name) > @@ -330,6 +332,8 @@ class VirtBase(object): > """ > try: > if self.vm_status is ST_PAUSE: > + # flag current vm is migration vm > + self.migration_vm =3D True > # connect backup vm dut and it just inherited from host > vm_dut =3D self.instantiate_vm_dut(set_target, cpu_topo, > bind_dev=3DFalse, autodetect_topo=3DFalse) > except Exception as vm_except: > @@ -419,9 +423,13 @@ class VirtBase(object): > vm_dut.host_dut =3D self.host_dut > vm_dut.host_session =3D self.host_session > vm_dut.init_log() > + vm_dut.migration_vm =3D self.migration_vm >=20 > read_cache =3D False > skip_setup =3D self.host_dut.skip_setup > + # if current vm is migration vm, skip compile dpdk > + if self.migration_vm: > + skip_setup =3D True > base_dir =3D self.host_dut.base_dir > vm_dut.set_speedup_options(read_cache, skip_setup) >=20 > diff --git a/framework/virt_dut.py b/framework/virt_dut.py index > b6f40d8..e4394b9 100644 > --- a/framework/virt_dut.py > +++ b/framework/virt_dut.py > @@ -58,6 +58,7 @@ class VirtDut(DPDKdut): > self.hyper =3D hyper > self.cpu_topo =3D cpu_topo > self.dut_id =3D dut_id > + self.migration_vm =3D False >=20 > self.vm_ip =3D crb['IP'] > self.NAME =3D 'virtdut' + LOG_NAME_SEP + '%s' % self.vm_ip @@ > -186,10 +187,13 @@ class VirtDut(DPDKdut): > self.update_ports() >=20 > # restore dut ports to kernel > - if self.virttype !=3D 'XEN': > - self.restore_interfaces() > - else: > - self.restore_interfaces_domu() > + # if current vm is migration vm, skip restore dut ports > + # because there maybe have some app have run > + if not self.migration_vm: > + if self.virttype !=3D 'XEN': > + self.restore_interfaces() > + else: > + self.restore_interfaces_domu() > # rescan ports after interface up > self.rescan_ports() >=20 > -- > 2.7.4