From: Qian Xu <qian.q.xu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH 1/5] add vhost-cuse implementations for virtio pci device
Date: Mon, 13 Jul 2015 09:14:06 +0800 [thread overview]
Message-ID: <1436750050-2479-2-git-send-email-qian.q.xu@intel.com> (raw)
In-Reply-To: <1436750050-2479-1-git-send-email-qian.q.xu@intel.com>
Signed-off-by: Qian Xu <qian.q.xu@intel.com>
diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py
index 4ccce81..44db411 100644
--- a/framework/qemu_kvm.py
+++ b/framework/qemu_kvm.py
@@ -85,7 +85,7 @@ class QEMUKvm(VirtBase):
self.char_idx = 0
self.netdev_idx = 0
self.pt_idx = 0
-
+ self.cuse_id = 0
# devices pass-through into vm
self.pt_devices = []
self.pci_maps = []
@@ -569,6 +569,8 @@ class QEMUKvm(VirtBase):
self.__add_vm_virtio_net_pci(**options)
elif options['driver'] == 'vhost-user':
self.__add_vm_virtio_user_pci(**options)
+ elif options['driver'] == 'vhost-cuse':
+ self.__add_vm_virtio_cuse_pci(**options)
def __add_vm_pci_assign(self, **options):
"""
@@ -620,6 +622,25 @@ class QEMUKvm(VirtBase):
self.__add_vm_virtio_net_pci(**opts)
+ def __add_vm_virtio_cuse_pci(self, **options):
+ """
+ driver virtio-net-pci
+ opt_mac: 52:54:00:00:00:01
+ """
+ separator = ','
+ dev_boot_line = '-netdev tap'
+ cuse_id = 'vhost%d' %self.cuse_id
+ dev_boot_line += separator + 'id=%s' %cuse_id + separator +'ifname=tap_%s' %cuse_id + separator +"vhost=on" +separator +"script=no"
+ self.cuse_id += 1
+ self.__add_boot_line(dev_boot_line)
+ # device parameter
+ opts = {'opt_netdev': '%s' % cuse_id ,
+ 'opt_id': '%s_net' % cuse_id}
+ if 'opt_mac' in options.keys() and options['opt_mac']:
+ opts['opt_mac'] = options['opt_mac']
+ print "debug info: add cuse info:", dev_boot_line
+ self.__add_vm_virtio_net_pci(**opts)
+
def __add_vm_virtio_net_pci(self, **options):
"""
driver: virtio-net-pci
--
2.1.0
next prev parent reply other threads:[~2015-07-13 1:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-13 1:14 [dts] [PATCH 0/5]Add vhost-user and vhost-cuse one vm sample case Qian Xu
2015-07-13 1:14 ` Qian Xu [this message]
2015-07-13 1:17 ` [dts] [PATCH 1/5] add vhost-cuse implementations for virtio pci device Liu, Yong
2015-07-13 1:18 ` Xu, Qian Q
2015-07-13 1:26 ` Liu, Yong
2015-07-13 1:14 ` [dts] [PATCH 2/5] add vhost-cuse sample config file for reference Qian Xu
2015-07-13 1:14 ` [dts] [PATCH 3/5] add the vhost-user " Qian Xu
2015-07-13 1:14 ` [dts] [PATCH 4/5] add vhost-cuse one vm sample Qian Xu
2015-07-13 1:19 ` Liu, Yong
2015-07-13 1:14 ` [dts] [PATCH 5/5] add vhost-user one vm sample case Qian Xu
2015-07-13 1:25 ` Liu, Yong
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=1436750050-2479-2-git-send-email-qian.q.xu@intel.com \
--to=qian.q.xu@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).