Message ID | 20160928205602.17275-11-mreitz@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Am 28.09.2016 um 22:56 hat Max Reitz geschrieben: > By adding an optional suffix to the files used for communication with a > VM, we can launch multiple VM instances concurrently. > > Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 5a2678f..c589deb 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -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
By adding an optional suffix to the files used for communication with a VM, we can launch multiple VM instances concurrently. Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/qemu-iotests/iotests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)