From: "Wang, Yinan" <yinan.wang@intel.com>
To: "Ma, LihongX" <lihongx.ma@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Subject: Re: [dts] [PATCH V1 2/3][migration] framework: update code support migration
Date: Thu, 10 Oct 2019 08:04:04 +0000 [thread overview]
Message-ID: <E0CBA5A1980F1F408E1F28F9991B5B1D50F1D92E@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1570666746-12853-2-git-send-email-lihongx.ma@intel.com>
Acked-by: Wang, Yinan <yinan.wang@intel.com>
> -----Original Message-----
> From: Ma, LihongX
> Sent: 2019年10月10日 8:19
> To: dts@dpdk.org
> Cc: Wang, Yinan <yinan.wang@intel.com>; Ma, LihongX <lihongx.ma@intel.com>
> Subject: [dts][PATCH V1 2/3][migration] framework: update code support
> migration
>
> 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
> b6f40d8..e4394b9 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 @@
> -186,10 +187,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
next prev parent reply other threads:[~2019-10-10 8:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 0:19 [dts] [PATCH V1 1/3][migration] conf: add config file of vhost_user_live_migration lihong
2019-10-10 0:19 ` [dts] [PATCH V1 2/3][migration] framework: update code support migration lihong
2019-10-10 8:04 ` Wang, Yinan [this message]
2019-10-10 0:19 ` [dts] [PATCH V1 3/3][migration] tests/vhost_user_live_migration: update code lihong
2019-10-10 8:03 ` Wang, Yinan
2019-10-10 8:04 ` [dts] [PATCH V1 1/3][migration] conf: add config file of vhost_user_live_migration Wang, Yinan
2019-10-12 6:09 ` Tu, Lijuan
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=E0CBA5A1980F1F408E1F28F9991B5B1D50F1D92E@SHSMSX104.ccr.corp.intel.com \
--to=yinan.wang@intel.com \
--cc=dts@dpdk.org \
--cc=lihongx.ma@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).