summary refs log tree commit diff stats
path: root/python/qemu/qtest.py
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2020-10-06 19:58:01 -0400
committerJohn Snow <jsnow@redhat.com>2020-10-20 09:37:57 -0400
commit652809dfa665860c1ea4622c540a30fbe18dc9e7 (patch)
tree0cb79a337e5a0e71699f6476f13eb4ef0d1d26ab /python/qemu/qtest.py
parentc5e61a6da84397fe8c2af9e381d8a619a3e32c10 (diff)
downloadfocaccia-qemu-652809dfa665860c1ea4622c540a30fbe18dc9e7.tar.gz
focaccia-qemu-652809dfa665860c1ea4622c540a30fbe18dc9e7.zip
python/machine.py: Don't modify state in _base_args()
Don't append to the _remove_files list during _base_args; instead do so
during _launch. Rework _base_args as a @property to help facilitate
this impression.

This has the additional benefit of making the type of _console_address
easier to analyze statically.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 20201006235817.3280413-5-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'python/qemu/qtest.py')
-rw-r--r--python/qemu/qtest.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/qemu/qtest.py b/python/qemu/qtest.py
index 7700c0b09b..7fde2565a0 100644
--- a/python/qemu/qtest.py
+++ b/python/qemu/qtest.py
@@ -19,7 +19,7 @@ subclass of QEMUMachine, respectively.
 
 import os
 import socket
-from typing import Optional, TextIO
+from typing import List, Optional, TextIO
 
 from .machine import QEMUMachine
 
@@ -111,8 +111,9 @@ class QEMUQtestMachine(QEMUMachine):
         self._qtest = None
         self._qtest_path = os.path.join(sock_dir, name + "-qtest.sock")
 
-    def _base_args(self):
-        args = super()._base_args()
+    @property
+    def _base_args(self) -> List[str]:
+        args = super()._base_args
         args.extend(['-qtest', 'unix:path=' + self._qtest_path,
                      '-accel', 'qtest'])
         return args