From eb38a257f3fbecee93a883ddfc62683e49c649a1 Mon Sep 17 00:00:00 2001 From: pmikus Date: Thu, 8 Dec 2016 14:28:52 +0100 Subject: 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 --- resources/libraries/python/QemuUtils.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'resources') 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: # 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) -- cgit 1.2.3-korg