summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2021-11-18 15:46:17 -0500
committerJohn Snow <jsnow@redhat.com>2021-11-22 18:40:59 -0500
commitb1ca99199320fcc010f407b84ac00d96e7e4baa1 (patch)
tree6c92c5fede832310a99ad8ab3fe7e08b974aa1fd /python
parent72b17fe715056c96ea73f187ab46721788b3a782 (diff)
downloadqemu-b1ca99199320fcc010f407b84ac00d96e7e4baa1.zip
python/machine: move more variable initializations to _pre_launch
No need to clear them only to set them later. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Message-id: 20211118204620.1897674-5-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'python')
-rw-r--r--python/qemu/machine/machine.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index ad529fd92a..f92e73de40 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -327,6 +327,14 @@ class QEMUMachine:
self._qemu_log_path = os.path.join(self.log_dir, self._name + ".log")
self._qemu_log_file = open(self._qemu_log_path, 'wb')
+ self._iolog = None
+ self._qemu_full_args = tuple(chain(
+ self._wrapper,
+ [self._binary],
+ self._base_args,
+ self._args
+ ))
+
def _post_launch(self) -> None:
if self._qmp_connection:
self._qmp.accept(self._qmp_timer)
@@ -390,8 +398,6 @@ class QEMUMachine:
if self._launched:
raise QEMUMachineError('VM already launched')
- self._iolog = None
- self._qemu_full_args = ()
try:
self._launch()
self._launched = True
@@ -410,12 +416,6 @@ class QEMUMachine:
Launch the VM and establish a QMP connection
"""
self._pre_launch()
- self._qemu_full_args = tuple(
- chain(self._wrapper,
- [self._binary],
- self._base_args,
- self._args)
- )
LOG.debug('VM launch command: %r', ' '.join(self._qemu_full_args))
# Cleaning up of this subprocess is guaranteed by _do_shutdown.