From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwXkc-0004s5-DO for qemu-devel@nongnu.org; Wed, 11 Nov 2015 10:57:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwXiW-0003BZ-M4 for qemu-devel@nongnu.org; Wed, 11 Nov 2015 10:55:58 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:36687 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwXiW-00037z-9l for qemu-devel@nongnu.org; Wed, 11 Nov 2015 10:53:48 -0500 From: Vladimir Sementsov-Ogievskiy Date: Wed, 11 Nov 2015 18:16:39 +0300 Message-Id: <1447255003-2043-10-git-send-email-vsementsov@virtuozzo.com> In-Reply-To: <1447255003-2043-1-git-send-email-vsementsov@virtuozzo.com> References: <1447255003-2043-1-git-send-email-vsementsov@virtuozzo.com> Subject: [Qemu-devel] [PATCH 09/13] iotests: maintain several vms in test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org, vsementsov@virtuozzo.com, quintela@redhat.com, dgilbert@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, amit.shah@redhat.com, den@openvz.org, jsnow@redhat.com The only problem with it is the same qmp socket name (which is vm._monitor_path) for all vms. And because of this second vm couldn't be lauched (vm.launch() fails because of socket is already in use). This patch adds a number of vm into vm._monitor_path Reviewed-by: John Snow Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index ff5905f..92b6d5e 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -120,11 +120,12 @@ def event_match(event, match=None): class VM(object): '''A QEMU VM''' + nb_vms = 0 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()) + self._monitor_path = os.path.join(test_dir, 'qemu-mon.%d.%d' % (os.getpid(), VM.nb_vms)) + self._qemu_log_path = os.path.join(test_dir, 'qemu-log.%d.%d' % (os.getpid(), VM.nb_vms)) + self._qtest_path = os.path.join(test_dir, 'qemu-qtest.%d.%d' % (os.getpid(), VM.nb_vms)) self._args = qemu_args + ['-chardev', 'socket,id=mon,path=' + self._monitor_path, '-mon', 'chardev=mon,mode=control', @@ -133,6 +134,7 @@ class VM(object): '-display', 'none', '-vga', 'none'] self._num_drives = 0 self._events = [] + VM.nb_vms += 1 # This can be used to add an unused monitor instance. def add_monitor_telnet(self, ip, port): -- 2.1.4