# 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:
- 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).
"""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).
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,'\
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)
# Create Virtio network device.
device = ' -device virtio-net-pci,netdev=vhost{0},mac={1},{2}'.format(
self._vhost_id, mac, extend_options)
{ "return": {} } response is QMP's success response. An error
response will contain the "error" keyword instead of "return".
"""
{ "return": {} } response is QMP's success response. An error
response will contain the "error" keyword instead of "return".
"""
"""
# TODO: remove to dedicated library
cmd_huge_size = "grep Hugepagesize /proc/meminfo | awk '{ print $2 }'"
"""
# TODO: remove to dedicated library
cmd_huge_size = "grep Hugepagesize /proc/meminfo | awk '{ print $2 }'"
- cmd = '{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10}'.format(bin_path,
- self._qemu_opt.get('smp'), mem, ssh_fwd,
+ cmd = '{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10}'.format(
+ bin_path, self._qemu_opt.get('smp'), mem, ssh_fwd,
self._qemu_opt.get('options'), drive, qmp, serial, qga, graphic,
pid)
try:
self._qemu_opt.get('options'), drive, qmp, serial, qga, graphic,
pid)
try:
- watchdog: watchdog action has been triggered
- guest-panicked: panicked as a result of guest OS panic
- watchdog: watchdog action has been triggered
- guest-panicked: panicked as a result of guest OS panic
version = ' --version={0}'.format(Constants.QEMU_INSTALL_VERSION)
force = ' --force' if force_install else ''
patch = ' --patch' if apply_patch else ''
version = ' --version={0}'.format(Constants.QEMU_INSTALL_VERSION)
force = ' --force' if force_install else ''
patch = ' --patch' if apply_patch else ''