[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V8 38/39] python/machine: add QEMUMachine accessors
From: |
Steve Sistare |
Subject: |
[PATCH V8 38/39] python/machine: add QEMUMachine accessors |
Date: |
Wed, 15 Jun 2022 07:52:25 -0700 |
Provide full_args() to return all command-line arguments used to start a
vm, some of which are not otherwise visible to QEMUMachine clients. This
is needed by the cpr test, which must start a vm, then pass all qemu
command-line arguments to the cpr-exec monitor call.
Provide reopen_qmp_connection() to reopen a closed monitor connection.
This is needed by cpr, because qemu-exec closes the monitor socket.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
---
python/qemu/machine/machine.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index 37191f4..60b934d 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -332,6 +332,11 @@ def args(self) -> List[str]:
"""Returns the list of arguments given to the QEMU binary."""
return self._args
+ @property
+ def full_args(self) -> List[str]:
+ """Returns the full list of arguments used to launch QEMU."""
+ return list(self._qemu_full_args)
+
def _pre_launch(self) -> None:
if self._console_set:
self._remove_files.append(self._console_address)
@@ -486,6 +491,15 @@ def _close_qmp_connection(self) -> None:
finally:
self._qmp_connection = None
+ def reopen_qmp_connection(self):
+ self._close_qmp_connection()
+ self._qmp_connection = QEMUMonitorProtocol(
+ self._monitor_address,
+ server=True,
+ nickname=self._name
+ )
+ self._qmp.accept(self._qmp_timer)
+
def _early_cleanup(self) -> None:
"""
Perform any cleanup that needs to happen before the VM exits.
--
1.8.3.1
- [PATCH V8 33/39] chardev: cpr framework, (continued)
- [PATCH V8 33/39] chardev: cpr framework, Steve Sistare, 2022/06/15
- [PATCH V8 35/39] chardev: cpr for pty, Steve Sistare, 2022/06/15
- [PATCH V8 32/39] loader: suppress rom_reset during cpr, Steve Sistare, 2022/06/15
- [PATCH V8 37/39] cpr: only-cpr-capable option, Steve Sistare, 2022/06/15
- [PATCH V8 27/39] vfio-pci: cpr part 1 (fd and dma), Steve Sistare, 2022/06/15
- [PATCH V8 34/39] chardev: cpr for simple devices, Steve Sistare, 2022/06/15
- [PATCH V8 39/39] tests/avocado: add cpr regression test, Steve Sistare, 2022/06/15
- [PATCH V8 30/39] vfio-pci: recover from unmap-all-vaddr failure, Steve Sistare, 2022/06/15
- [PATCH V8 38/39] python/machine: add QEMUMachine accessors,
Steve Sistare <=
- [PATCH V8 01/39] migration: fix populate_vfio_info, Steve Sistare, 2022/06/15
- [PATCH V8 05/39] vl: start on wakeup request, Steve Sistare, 2022/06/15
- [PATCH V8 07/39] cpr: reboot HMP interfaces, Steve Sistare, 2022/06/15
- [PATCH V8 16/39] qapi: strv_from_strList, Steve Sistare, 2022/06/15
- [PATCH V8 15/39] qapi: QAPI_LIST_LENGTH, Steve Sistare, 2022/06/15