mirror of
https://github.com/mborgerson/xemu.git
synced 2025-12-01 16:10:01 +00:00
Python: expose QEMUMachine's temporary directory
Each instance of qemu.machine.QEMUMachine currently has a "test directory", which may not have any relation to a "test", and it's really a temporary directory. Users instantiating the QEMUMachine class will be able to set the location of the directory that will *contain* the QEMUMachine unique temporary directory, so that parameter name has been changed from test_dir to base_temp_dir. A property has been added to allow users to access it without using private attributes, and with that, the directory is created on first use of the property. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210211220146.2525771-3-crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com>
This commit is contained in:
@ -112,14 +112,14 @@ class QEMUQtestMachine(QEMUMachine):
|
||||
binary: str,
|
||||
args: Sequence[str] = (),
|
||||
name: Optional[str] = None,
|
||||
test_dir: str = "/var/tmp",
|
||||
base_temp_dir: str = "/var/tmp",
|
||||
socket_scm_helper: Optional[str] = None,
|
||||
sock_dir: Optional[str] = None):
|
||||
if name is None:
|
||||
name = "qemu-%d" % os.getpid()
|
||||
if sock_dir is None:
|
||||
sock_dir = test_dir
|
||||
super().__init__(binary, args, name=name, test_dir=test_dir,
|
||||
sock_dir = base_temp_dir
|
||||
super().__init__(binary, args, name=name, base_temp_dir=base_temp_dir,
|
||||
socket_scm_helper=socket_scm_helper,
|
||||
sock_dir=sock_dir)
|
||||
self._qtest: Optional[QEMUQtestProtocol] = None
|
||||
|
||||
Reference in New Issue
Block a user