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 6495CA2EFC for ; Tue, 15 Oct 2019 05:02:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4ABC61C2B3; Tue, 15 Oct 2019 05:02:09 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 6E2CB1C29D for ; Tue, 15 Oct 2019 05:02:06 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2019 20:02:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,297,1566889200"; d="scan'208";a="185678788" Received: from dpdk-lihong-ub1604.sh.intel.com ([10.67.118.203]) by orsmga007.jf.intel.com with ESMTP; 14 Oct 2019 20:02:04 -0700 From: lihong To: dts@dpdk.org Cc: yinan.wang@intel.com, lihong Date: Tue, 15 Oct 2019 03:37:01 +0800 Message-Id: <1571081822-5323-2-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1571081822-5323-1-git-send-email-lihongx.ma@intel.com> References: <1571081822-5323-1-git-send-email-lihongx.ma@intel.com> Subject: [dts] [PATCH V2 2/3][migration] framework: update code for 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" Signed-off-by: lihong --- framework/virt_base.py | 8 ++++++++ framework/virt_dut.py | 12 ++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) 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 = dut self.vm_name = vm_name self.suite = suite_name + # indicate whether the current vm is migration vm + self.migration_vm = False # create self used host session, need close it later self.host_session = 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 = True # connect backup vm dut and it just inherited from host vm_dut = self.instantiate_vm_dut(set_target, cpu_topo, bind_dev=False, autodetect_topo=False) except Exception as vm_except: @@ -419,9 +423,13 @@ class VirtBase(object): vm_dut.host_dut = self.host_dut vm_dut.host_session = self.host_session vm_dut.init_log() + vm_dut.migration_vm = self.migration_vm read_cache = False skip_setup = self.host_dut.skip_setup + # if current vm is migration vm, skip compile dpdk + if self.migration_vm: + skip_setup = True base_dir = self.host_dut.base_dir vm_dut.set_speedup_options(read_cache, skip_setup) diff --git a/framework/virt_dut.py b/framework/virt_dut.py index 599ddca..a916b72 100644 --- a/framework/virt_dut.py +++ b/framework/virt_dut.py @@ -58,6 +58,7 @@ class VirtDut(DPDKdut): self.hyper = hyper self.cpu_topo = cpu_topo self.dut_id = dut_id + self.migration_vm = False self.vm_ip = crb['IP'] self.NAME = 'virtdut' + LOG_NAME_SEP + '%s' % self.vm_ip @@ -188,10 +189,13 @@ class VirtDut(DPDKdut): self.update_ports() # restore dut ports to kernel - if self.virttype != '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 != 'XEN': + self.restore_interfaces() + else: + self.restore_interfaces_domu() # rescan ports after interface up self.rescan_ports() -- 2.7.4