summary refs log tree commit diff stats
path: root/python/qemu/qtest.py
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-10-17 15:31:34 +0200
committerMax Reitz <mreitz@redhat.com>2019-10-28 11:22:30 +0100
commit32558ce7a43dc7e8e3d065ac26eb2cdbfa34b36b (patch)
tree0870de2d8eb1c97dc7459b369d4996374df8bbcd /python/qemu/qtest.py
parentc7df3f19d22dc3c13f7ca64d7dc15a4389ee63b8 (diff)
downloadfocaccia-qemu-32558ce7a43dc7e8e3d065ac26eb2cdbfa34b36b.tar.gz
focaccia-qemu-32558ce7a43dc7e8e3d065ac26eb2cdbfa34b36b.zip
iotests.py: Store socket files in $SOCK_DIR
iotests.py itself does not store socket files, but machine.py and
qtest.py do.  iotests.py needs to pass the respective path to them, and
they need to adhere to it.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 20191017133155.5327-3-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'python/qemu/qtest.py')
-rw-r--r--python/qemu/qtest.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/qemu/qtest.py b/python/qemu/qtest.py
index 3f1d2cb325..d24ad04256 100644
--- a/python/qemu/qtest.py
+++ b/python/qemu/qtest.py
@@ -84,14 +84,17 @@ class QEMUQtestMachine(QEMUMachine):
     '''A QEMU VM'''
 
     def __init__(self, binary, args=None, name=None, test_dir="/var/tmp",
-                 socket_scm_helper=None):
+                 socket_scm_helper=None, sock_dir=None):
         if name is None:
             name = "qemu-%d" % os.getpid()
+        if sock_dir is None:
+            sock_dir = test_dir
         super(QEMUQtestMachine,
               self).__init__(binary, args, name=name, test_dir=test_dir,
-                             socket_scm_helper=socket_scm_helper)
+                             socket_scm_helper=socket_scm_helper,
+                             sock_dir=sock_dir)
         self._qtest = None
-        self._qtest_path = os.path.join(test_dir, name + "-qtest.sock")
+        self._qtest_path = os.path.join(sock_dir, name + "-qtest.sock")
 
     def _base_args(self):
         args = super(QEMUQtestMachine, self)._base_args()