aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/QemuUtils.py
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2016-12-08 14:28:52 +0100
committerPeter Mikus <pmikus@cisco.com>2016-12-08 14:14:14 +0000
commiteb38a257f3fbecee93a883ddfc62683e49c649a1 (patch)
tree96d4409867eab514541fd7152cad4a9ebbc772a3 /resources/libraries/python/QemuUtils.py
parent17deb2dd2c906dd2f674ea433d7310f8db1c6894 (diff)
CSIT-494 Add multi-queue support for Qemu
Add multi-queue support when starting qemu. Full implementation will be following in near future. Change-Id: I743bbde67254b26a4e4e98072bad57dde728845a Signed-off-by: pmikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries/python/QemuUtils.py')
-rw-r--r--resources/libraries/python/QemuUtils.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/resources/libraries/python/QemuUtils.py b/resources/libraries/python/QemuUtils.py
index ea1d56a3c0..1e3a8aa6b6 100644
--- a/resources/libraries/python/QemuUtils.py
+++ b/resources/libraries/python/QemuUtils.py
@@ -39,7 +39,7 @@ class QemuUtils(object):
# Daemonize the QEMU process after initialization. Default one
# management interface.
self._qemu_opt['options'] = '-cpu host -daemonize -enable-kvm ' \
- '-machine pc-1.0,accel=kvm,usb=off,mem-merge=off ' \
+ '-machine pc,accel=kvm,usb=off,mem-merge=off ' \
'-net nic,macaddr=52:54:00:00:02:01 -balloon none'
self._qemu_opt['ssh_fwd_port'] = 10022
# Default serial console port
@@ -60,6 +60,8 @@ class QemuUtils(object):
'password': 'cisco',
'interfaces': {},
}
+ # Virtio queue count
+ self._qemu_opt['queues'] = 1
self._vhost_id = 0
self._ssh = None
self._node = None
@@ -194,15 +196,15 @@ class QemuUtils(object):
chardev += ',server'
self._qemu_opt['options'] += chardev
# Create Vhost-user network backend.
- netdev = ' -netdev vhost-user,id=vhost{0},chardev=char{0}'.format(
- self._vhost_id)
+ netdev = ' -netdev vhost-user,id=vhost{0},chardev=char{0},'\
+ 'queues={1}'.format(self._vhost_id, self._qemu_opt['queues'])
self._qemu_opt['options'] += netdev
# If MAC is not specified use autogenerated 52:54:00:00:04:<vhost_id>
# e.g. vhost1 MAC is 52:54:00:00:04:01
if mac is None:
mac = '52:54:00:00:04:{0:02x}'.format(self._vhost_id)
- extend_options = 'csum=off,gso=off,guest_tso4=off,guest_tso6=off,'\
- 'guest_ecn=off,mrg_rxbuf=off'
+ extend_options = 'mq=on,csum=off,gso=off,guest_tso4=off,'\
+ 'guest_tso6=off,guest_ecn=off,mrg_rxbuf=off'
# Create Virtio network device.
device = ' -device virtio-net-pci,netdev=vhost{0},mac={1},{2}'.format(
self._vhost_id, mac, extend_options)