[PATCH 3/5] python/machine.py: store qemu console fd before closing

Vladimir Sementsov-Ogievskiy <[email protected]>
Newsgroups gmane.comp.emulators.qemu
Message-ID <[email protected]>
We'll need it soon to implement test for cpr-exec mode of
tap-fd-migration.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
---
 python/qemu/machine/machine.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index 00154b8591f..14ba8e80aac 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -159,6 +159,7 @@ def __init__(self,
         self._sock_pair: Optional[Tuple[socket.socket, socket.socket]] = None
         self._cons_sock_pair: Optional[
             Tuple[socket.socket, socket.socket]] = None
+        self._cons_sock_saved_fd: Optional[int] = None
         self._temp_dir: Optional[str] = None
         self._base_temp_dir = base_temp_dir
         self._log_dir = log_dir
@@ -388,6 +389,7 @@ def _post_launch(self) -> None:
         if self._sock_pair:
             self._sock_pair[0].close()
         if self._cons_sock_pair:
+            self._cons_sock_saved_fd = self._cons_sock_pair[0].fileno()
             self._cons_sock_pair[0].close()
 
         if self._qmp_connection:
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.