Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Simplify show_papi_history
[csit.git]
/
resources
/
libraries
/
python
/
QemuUtils.py
diff --git
a/resources/libraries/python/QemuUtils.py
b/resources/libraries/python/QemuUtils.py
index
5880028
..
6fad6ed
100644
(file)
--- a/
resources/libraries/python/QemuUtils.py
+++ b/
resources/libraries/python/QemuUtils.py
@@
-1,4
+1,4
@@
-# Copyright (c) 201
8
Cisco and/or its affiliates.
+# Copyright (c) 201
9
Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@
-23,7
+23,7
@@
from distutils.version import StrictVersion
from robot.api import logger
from resources.libraries.python.ssh import SSH, SSHTimeout
from robot.api import logger
from resources.libraries.python.ssh import SSH, SSHTimeout
-from resources.libraries.python.
c
onstants import Constants
+from resources.libraries.python.
C
onstants import Constants
from resources.libraries.python.DUTSetup import DUTSetup
from resources.libraries.python.topology import NodeType, Topology
from resources.libraries.python.DUTSetup import DUTSetup
from resources.libraries.python.topology import NodeType, Topology
@@
-213,7
+213,10
@@
class QemuUtils(object):
self._ssh = SSH()
self._ssh.connect(node)
self._vm_info['host'] = node['host']
self._ssh = SSH()
self._ssh.connect(node)
self._vm_info['host'] = node['host']
-
+ if node['port'] != 22:
+ self._vm_info['host_port'] = node['port']
+ self._vm_info['host_username'] = node['username']
+ self._vm_info['host_password'] = node['password']
arch = Topology.get_node_arch(node)
self._qemu_opt['qemu_bin'] = 'qemu-system-{arch}'.format(arch=arch)
arch = Topology.get_node_arch(node)
self._qemu_opt['qemu_bin'] = 'qemu-system-{arch}'.format(arch=arch)
@@
-251,17
+254,20
@@
class QemuUtils(object):
format(qemu_id=self._qemu_id, vhost_id=self._vhost_id))\
if mac is None else mac
format(qemu_id=self._qemu_id, vhost_id=self._vhost_id))\
if mac is None else mac
- queue_size = ('
,
rx_queue_size={queue_size},tx_queue_size={queue_size}'.
+ queue_size = ('rx_queue_size={queue_size},tx_queue_size={queue_size}'.
format(queue_size=self._qemu_opt.get('queue_size')))\
if self._qemu_opt.get('queue_size') else ''
format(queue_size=self._qemu_opt.get('queue_size')))\
if self._qemu_opt.get('queue_size') else ''
+ vector_size = ('vectors={vectors}'.
+ format(vectors=2*self._qemu_opt.get('queue_count')+2))\
+ if self._qemu_opt.get('queue_count') else ''
# Create Virtio network device.
device = (' -device virtio-net-pci,netdev=vhost{vhost_id},mac={mac},'
# Create Virtio network device.
device = (' -device virtio-net-pci,netdev=vhost{vhost_id},mac={mac},'
- 'mq=on,
csum=off,gso=off,guest_tso4=off,guest_tso6
=off,'
- 'guest_
ecn=off,mrg_rxbuf={mbuf}
{queue_size}'.
+ 'mq=on,
{vector_size},csum=off,gso=off,guest_tso4
=off,'
+ 'guest_
tso6=off,guest_ecn=off,mrg_rxbuf={mbuf},
{queue_size}'.
format(vhost_id=self._vhost_id, mac=mac,
format(vhost_id=self._vhost_id, mac=mac,
- mbuf='on' if jumbo_frames else 'off',
- queue_size=queue_size))
+ mbuf='on
,host_mtu=9200
' if jumbo_frames else 'off',
+ queue_size=queue_size
, vector_size=vector_size
))
self._qemu_opt['options'] += device
# Add interface MAC and socket to the node dict
if_data = {'mac_address': mac, 'socket': socket}
self._qemu_opt['options'] += device
# Add interface MAC and socket to the node dict
if_data = {'mac_address': mac, 'socket': socket}