From patchwork Mon Feb 29 23:19:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 8460281 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 05BB09F52D for ; Mon, 29 Feb 2016 23:24:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7130620204 for ; Mon, 29 Feb 2016 23:24:11 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C2218201BB for ; Mon, 29 Feb 2016 23:24:10 +0000 (UTC) Received: from localhost ([::1]:39672 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaXAg-0000cQ-1r for patchwork-qemu-devel@patchwork.kernel.org; Mon, 29 Feb 2016 18:24:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaX6t-0002FD-6b for qemu-devel@nongnu.org; Mon, 29 Feb 2016 18:20:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaX6s-0006N4-97 for qemu-devel@nongnu.org; Mon, 29 Feb 2016 18:20:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaX6l-0006K7-LM; Mon, 29 Feb 2016 18:20:09 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 5A8B364363; Mon, 29 Feb 2016 23:20:07 +0000 (UTC) Received: from localhost (ovpn-116-81.ams2.redhat.com [10.36.116.81]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1TNK5ld018932 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 29 Feb 2016 18:20:06 -0500 From: Max Reitz To: qemu-block@nongnu.org Date: Tue, 1 Mar 2016 00:19:31 +0100 Message-Id: <1456787973-19348-15-git-send-email-mreitz@redhat.com> In-Reply-To: <1456787973-19348-1-git-send-email-mreitz@redhat.com> References: <1456787973-19348-1-git-send-email-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 29 Feb 2016 23:20:07 +0000 (UTC) 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 v2 14/16] 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 dd8805a..fed5301 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -130,10 +130,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',