[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/25] python/machine: move socket setup out of _base_args propert
From: |
John Snow |
Subject: |
[PULL 01/25] python/machine: move socket setup out of _base_args property |
Date: |
Fri, 13 Oct 2023 15:09:16 -0400 |
This property isn't meant to do much else besides return a list of
strings, so move this setup back out into _pre_launch().
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20230928044943.849073-2-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
python/qemu/machine/machine.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index 35d5a672db..345610d6e4 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -301,9 +301,7 @@ def _base_args(self) -> List[str]:
if self._qmp_set:
if self._sock_pair:
- fd = self._sock_pair[0].fileno()
- os.set_inheritable(fd, True)
- moncdev = f"socket,id=mon,fd={fd}"
+ moncdev = f"socket,id=mon,fd={self._sock_pair[0].fileno()}"
elif isinstance(self._monitor_address, tuple):
moncdev = "socket,id=mon,host={},port={}".format(
*self._monitor_address
@@ -340,6 +338,7 @@ def _pre_launch(self) -> None:
if self._qmp_set:
if self._monitor_address is None:
self._sock_pair = socket.socketpair()
+ os.set_inheritable(self._sock_pair[0].fileno(), True)
sock = self._sock_pair[1]
if isinstance(self._monitor_address, str):
self._remove_files.append(self._monitor_address)
--
2.41.0
- [PULL 08/25] python/qmp: remove Server.wait_closed() call for Python 3.12, (continued)
- [PULL 08/25] python/qmp: remove Server.wait_closed() call for Python 3.12, John Snow, 2023/10/13
- [PULL 03/25] python/console_socket: accept existing FD in initializer, John Snow, 2023/10/13
- [PULL 02/25] python/machine: close sock_pair in cleanup path, John Snow, 2023/10/13
- [PULL 04/25] python/machine: use socketpair() for console connections, John Snow, 2023/10/13
- [PULL 09/25] configure: fix error message to say Python 3.8, John Snow, 2023/10/13
- [PULL 11/25] python/qemu/qmp/legacy: cmd(): drop cmd_id unused argument, John Snow, 2023/10/13
- [PULL 05/25] python/machine: use socketpair() for qtest connection, John Snow, 2023/10/13
- [PULL 07/25] Python/iotests: Add type hint for nbd module, John Snow, 2023/10/13
- [PULL 06/25] python/machine: remove unused sock_dir argument, John Snow, 2023/10/13
- [PULL 10/25] Python: Enable python3.12 support, John Snow, 2023/10/13
- [PULL 01/25] python/machine: move socket setup out of _base_args property,
John Snow <=
- [PULL 12/25] qmp_shell.py: _fill_completion() use .command() instead of .cmd(), John Snow, 2023/10/13
- [PULL 14/25] python: rename QEMUMonitorProtocol.cmd() to cmd_raw(), John Snow, 2023/10/13
- [PULL 16/25] python/machine.py: upgrade vm.cmd() method, John Snow, 2023/10/13
- [PULL 13/25] scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd(), John Snow, 2023/10/13
- [PULL 22/25] iotests.py: pause_job(): drop return value, John Snow, 2023/10/13
- [PULL 17/25] iotests: QemuStorageDaemon: add cmd() method like in QEMUMachine., John Snow, 2023/10/13
- [PULL 18/25] iotests: add some missed checks of qmp result, John Snow, 2023/10/13
- [PULL 19/25] iotests: refactor some common qmp result checks into generic pattern, John Snow, 2023/10/13
- [PULL 15/25] python/qemu: rename command() to cmd(), John Snow, 2023/10/13
- [PULL 24/25] scripts: add python_qmp_updater.py, John Snow, 2023/10/13