diff options
author | pmikus <pmikus@cisco.com> | 2017-04-05 09:35:05 +0200 |
---|---|---|
committer | Matej Klotton <mklotton@cisco.com> | 2017-04-07 08:01:55 +0000 |
commit | ffd596f616dc9a65e113b25ba72b00ce6dd42a7b (patch) | |
tree | ec1c21921188a62b627d60347972d8b6dc123a94 /resources/libraries/python/QemuUtils.py | |
parent | 0b7283e206789dc8864d15f255cc9677de0b3d97 (diff) |
CSIT-553 Make QEMU bin configurable
Add option to set path for QEMU binary and make it configurable in perf
testaces as global variable.
Change-Id: I95f4b1ab790b576f1eca02ccdb86f7a6ced80630
Signed-off-by: pmikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries/python/QemuUtils.py')
-rw-r--r-- | resources/libraries/python/QemuUtils.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/resources/libraries/python/QemuUtils.py b/resources/libraries/python/QemuUtils.py index 675f074570..f926d63caf 100644 --- a/resources/libraries/python/QemuUtils.py +++ b/resources/libraries/python/QemuUtils.py @@ -26,10 +26,10 @@ from resources.libraries.python.topology import NodeType class QemuUtils(object): """QEMU utilities.""" - __QEMU_BIN = '/usr/bin/qemu-system-x86_64' - def __init__(self, qemu_id=1): self._qemu_id = qemu_id + # Path to QEMU binary + self._qemu_bin = '/usr/bin/qemu-system-x86_64' # QEMU Machine Protocol socket self._qmp_sock = '/tmp/qmp{0}.sock'.format(self._qemu_id) # QEMU Guest Agent socket @@ -69,8 +69,16 @@ class QemuUtils(object): self._node = None self._socks = [self._qmp_sock, self._qga_sock] + def qemu_set_bin(self, path): + """Set binary path for QEMU. + + :param path: Absolute path in filesystem. + :type path: str + """ + self._qemu_bin = path + def qemu_set_smp(self, cpus, cores, threads, sockets): - """Set SMP option for QEMU + """Set SMP option for QEMU. :param cpus: Number of CPUs. :param cores: Number of CPU cores on one socket. @@ -520,7 +528,7 @@ class QemuUtils(object): # Run QEMU cmd = '{0} {1} {2} {3} {4} {5} {6} {7} {8} {9}'.format( - self.__QEMU_BIN, self._qemu_opt.get('smp'), mem, ssh_fwd, + self._qemu_bin, self._qemu_opt.get('smp'), mem, ssh_fwd, self._qemu_opt.get('options'), drive, qmp, serial, qga, graphic) (ret_code, _, stderr) = self._ssh.exec_command_sudo(cmd, timeout=300) |