From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ansCj-0007t4-Rm for qemu-devel@nongnu.org; Wed, 06 Apr 2016 14:29:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ansCi-00070h-Sz for qemu-devel@nongnu.org; Wed, 06 Apr 2016 14:29:25 -0400 From: Max Reitz Date: Wed, 6 Apr 2016 20:28:48 +0200 Message-Id: <1459967330-4573-13-git-send-email-mreitz@redhat.com> In-Reply-To: <1459967330-4573-1-git-send-email-mreitz@redhat.com> References: <1459967330-4573-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v3 12/14] iotests.py: Allow concurrent qemu instances List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: Kevin Wolf , Markus Armbruster , qemu-devel@nongnu.org, Max Reitz , Paolo Bonzini , Luiz Capitulino 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 --- tests/qemu-iotests/iotests.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index b3c00dd..ef7e52f 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -157,10 +157,13 @@ def event_match(event, match=None): class VM(object): '''A QEMU VM''' - def __init__(self): - self._monitor_path = os.path.join(test_dir, 'qemu-mon.%d' % os.getpid()) - self._qemu_log_path = os.path.join(test_dir, 'qemu-log.%d' % os.getpid()) - self._qtest_path = os.path.join(test_dir, 'qemu-qtest.%d' % os.getpid()) + def __init__(self, path_suffix=''): + self._monitor_path = os.path.join(test_dir, 'qemu-mon%s.%d' % + (path_suffix, os.getpid())) + self._qemu_log_path = os.path.join(test_dir, 'qemu-log%s.%d' % + (path_suffix, os.getpid())) + self._qtest_path = os.path.join(test_dir, 'qemu-qtest%s.%d' % + (path_suffix, os.getpid())) self._args = qemu_args + ['-chardev', 'socket,id=mon,path=' + self._monitor_path, '-mon', 'chardev=mon,mode=control', -- 2.8.0