X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FQemuUtils.py;h=42ccb8c9dd049ce4856b0e34a13b3d7c8aff2309;hb=73a01b1a7fc836c964627eea2c08106df0da5aee;hp=aa45ce08eff555f88a3e36d0c672e7fed3ca3131;hpb=6b6b146d51013b58b8637db59d9f01d6e62c4332;p=csit.git diff --git a/resources/libraries/python/QemuUtils.py b/resources/libraries/python/QemuUtils.py index aa45ce08ef..42ccb8c9dd 100644 --- a/resources/libraries/python/QemuUtils.py +++ b/resources/libraries/python/QemuUtils.py @@ -192,16 +192,19 @@ class QemuUtils(object): arch = Topology.get_node_arch(node) self._qemu_bin = 'qemu-system-{arch}'.format(arch=arch) - def qemu_add_vhost_user_if(self, socket, server=True, mac=None): + def qemu_add_vhost_user_if(self, socket, server=True, mac=None, + jumbo_frames=False): """Add Vhost-user interface. :param socket: Path of the unix socket. :param server: If True the socket shall be a listening socket. :param mac: Vhost-user interface MAC address (optional, otherwise is - used auto-generated MAC 52:54:00:00:xx:yy). + used auto-generated MAC 52:54:00:00:xx:yy). + :param jumbo_frames: Set True if jumbo frames are used in the test. :type socket: str :type server: bool :type mac: str + :type jumbo_frames: bool """ self._vhost_id += 1 # Create unix socket character device. @@ -221,7 +224,11 @@ class QemuUtils(object): mac = '52:54:00:00:{0:02x}:{1:02x}'.\ format(self._qemu_id, self._vhost_id) extend_options = 'mq=on,csum=off,gso=off,guest_tso4=off,'\ - 'guest_tso6=off,guest_ecn=off,mrg_rxbuf=off' + 'guest_tso6=off,guest_ecn=off' + if jumbo_frames: + extend_options += ",mrg_rxbuf=on" + else: + extend_options += ",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) @@ -681,6 +688,10 @@ class QemuUtils(object): ssh.connect(node) directory = ' --directory={0}'.format(Constants.QEMU_INSTALL_DIR) + if apply_patch: + directory += '-patch' + else: + directory += '-base' version = ' --version={0}'.format(Constants.QEMU_INSTALL_VERSION) force = ' --force' if force_install else '' patch = ' --patch' if apply_patch else ''