From patchwork Wed Apr 6 18:28:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 607145 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qgDs05qhLz9t4T for ; Thu, 7 Apr 2016 04:34:12 +1000 (AEST) Received: from localhost ([::1]:45042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ansHK-0000X3-Vv for incoming@patchwork.ozlabs.org; Wed, 06 Apr 2016 14:34:11 -0400 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 Received: from mx1.redhat.com ([209.132.183.28]:41081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ansCd-0006yl-Sm; Wed, 06 Apr 2016 14:29:19 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A6FD558A1; Wed, 6 Apr 2016 18:29:19 +0000 (UTC) Received: from localhost (ovpn-116-130.ams2.redhat.com [10.36.116.130]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u36ITHfm005393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 Apr 2016 14:29:19 -0400 From: Max Reitz To: qemu-block@nongnu.org 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Markus Armbruster , qemu-devel@nongnu.org, Max Reitz , Paolo Bonzini , Luiz Capitulino Subject: [Qemu-devel] [PATCH v3 12/14] iotests.py: Allow concurrent qemu instances X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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',