From: Marvin Liu <yong.liu@intel.com>
To: dts@dpdk.org
Cc: Marvin Liu <yong.liu@intel.com>
Subject: [dts] [PATCH v1 2/3] framework/virt_base: add default kernel driver option
Date: Thu, 8 Mar 2018 01:06:07 +0800 [thread overview]
Message-ID: <1520442368-77344-2-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1520442368-77344-1-git-send-email-yong.liu@intel.com>
If default driver is configured for VM, it will be setup when
initializing VM. Default kernel driver is DPDK igb_uio, suite owner can
change the default setting in VM local configuration file.
Signed-off-by: Marvin Liu <yong.liu@intel.com>
diff --git a/conf/virt_global.cfg b/conf/virt_global.cfg
index 58ca061..e47c6f3 100644
--- a/conf/virt_global.cfg
+++ b/conf/virt_global.cfg
@@ -24,6 +24,8 @@ cpu =
number=4,cpupin=3 4 5 6;
mem =
size=2048;
+def_driver =
+ driver_name=igb_uio;
[KVM]
cpu =
model=host,number=4,cpupin=3 4 5 6;
@@ -35,6 +37,8 @@ control =
type=qga;
vnc =
disable=False;
+def_driver =
+ driver_name=igb_uio;
[XEN]
cpu =
number=4,cpupin=3 4 5 6;
@@ -42,3 +46,5 @@ mem =
size=2048;
vif =
mac=random,bridge=br0
+def_driver =
+ driver_name=igb_uio;
diff --git a/framework/virt_base.py b/framework/virt_base.py
index b26a25a..fd2faeb 100644
--- a/framework/virt_base.py
+++ b/framework/virt_base.py
@@ -92,6 +92,10 @@ class VirtBase(object):
# vm status is running by default, only be changed in internal module
self.vm_status = ST_RUNNING
+ # by default no special kernel module is required
+ self.def_driver = ''
+ self.driver_mode = ''
+
def get_virt_type(self):
"""
Get the virtual type, such as KVM, XEN or LIBVIRT.
@@ -184,6 +188,15 @@ class VirtBase(object):
self.host_logger.error(traceback.print_exception(*sys.exc_info()))
raise exception.VirtConfigParamException(key)
+ def add_vm_def_driver(self, **options):
+ """
+ Set default driver which may required when setup VM
+ """
+ if 'driver_name' in options.keys():
+ self.def_driver = options['driver_name']
+ if 'driver_mode' in options.keys():
+ self.driver_mode = options['driver_mode']
+
def find_option_index(self, option):
"""
Find the boot option in the params which is generated from
@@ -423,7 +436,7 @@ class VirtBase(object):
vm_dut.prerequisites(self.host_dut.package, self.host_dut.patches, autodetect_topo)
if set_target:
target = self.host_dut.target
- vm_dut.set_target(target, bind_dev)
+ vm_dut.set_target(target, bind_dev, self.def_driver, self.driver_mode)
except:
raise exception.VirtDutInitException(vm_dut)
return None
--
1.9.3
next prev parent reply other threads:[~2018-03-07 9:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 17:06 [dts] [PATCH v1 1/3] framework/project_dpdk: add new arguments in setup_modules function Marvin Liu
2018-03-07 17:06 ` Marvin Liu [this message]
2018-03-07 17:06 ` [dts] [PATCH v1 3/3] framework/virt_dut: setup configured kernel module Marvin Liu
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=1520442368-77344-2-git-send-email-yong.liu@intel.com \
--to=yong.liu@intel.com \
--cc=dts@dpdk.org \
/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).