test suite reviews and discussions
 help / color / mirror / Atom feed
From: lihong <lihongx.ma@intel.com>
To: dts@dpdk.org
Cc: yinan.wang@intel.com, lihong <lihongx.ma@intel.com>
Subject: [dts] [PATCH V2 2/3][migration] framework: update code for migration
Date: Tue, 15 Oct 2019 03:37:01 +0800	[thread overview]
Message-ID: <1571081822-5323-2-git-send-email-lihongx.ma@intel.com> (raw)
In-Reply-To: <1571081822-5323-1-git-send-email-lihongx.ma@intel.com>

Signed-off-by: lihong <lihongx.ma@intel.com>
---
 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


  reply	other threads:[~2019-10-15  3:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 19:37 [dts] [PATCH V2 1/3][migration] conf/vhost_user_live_migration: update cfg file lihong
2019-10-14 19:37 ` lihong [this message]
2019-10-17  1:57   ` [dts] [PATCH V2 2/3][migration] framework: update code for migration Wang, Yinan
2019-11-13  1:06   ` Wang, Yinan
2019-10-14 19:37 ` [dts] [PATCH V2 3/3][migration] tests/vhost_user_live_migration: update code lihong
2019-10-17  1:56   ` Wang, Yinan
2019-11-13  1:05   ` Wang, Yinan
2019-10-17  1:57 ` [dts] [PATCH V2 1/3][migration] conf/vhost_user_live_migration: update cfg file Wang, Yinan
2019-10-21  2:34 ` Tu, Lijuan
2019-11-13  1:06 ` Wang, Yinan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1571081822-5323-2-git-send-email-lihongx.ma@intel.com \
    --to=lihongx.ma@intel.com \
    --cc=dts@dpdk.org \
    --cc=yinan.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).