Skip to content

Commit

Permalink
iotests.py: Allow concurrent qemu instances
Browse files Browse the repository at this point in the history
By adding an optional suffix to the files used for communication with a
VM, we can launch multiple VM instances concurrently.

Reviewed-by: Kevin Wolf <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
  • Loading branch information
XanClic authored and kevmw committed Oct 27, 2016
1 parent bec8777 commit 5fcbdf5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/qemu-iotests/iotests.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ def log(msg, filters=[]):
class VM(qtest.QEMUQtestMachine):
'''A QEMU VM'''

def __init__(self):
super(VM, self).__init__(qemu_prog, qemu_opts, test_dir=test_dir,
def __init__(self, path_suffix=''):
name = "qemu%s-%d" % (path_suffix, os.getpid())
super(VM, self).__init__(qemu_prog, qemu_opts, name=name,
test_dir=test_dir,
socket_scm_helper=socket_scm_helper)
if debug:
self._debug = True
Expand Down

0 comments on commit 5fcbdf5

Please sign in to comment.