aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2023-09-28 00:49:43 -0400
committerJohn Snow <jsnow@redhat.com>2023-10-11 16:02:02 -0400
commit46d4747ab59721e657c0012d2f2ca6f3aeb7085d (patch)
tree8dbba7bca7897973da5f3ef4983b090a8b1e1078 /python
parentd39673781361ed528c2afba7197f26481caab482 (diff)
python/machine: remove unused sock_dir argument
By using a socketpair for all of the sockets managed by the VM class and its extensions, we don't need the sock_dir argument anymore, so remove it. We only added this argument so that we could specify a second, shorter temporary directory for cases where the temp/log dirs were "too long" as a socket name on macOS. We don't need it for this class now. In one case, avocado testing takes over responsibility for creating an appropriate sockdir. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20230928044943.849073-7-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'python')
-rw-r--r--python/qemu/machine/machine.py18
-rw-r--r--python/qemu/machine/qtest.py5
2 files changed, 1 insertions, 22 deletions
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index 4156b8cf7d..d539e91268 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -127,7 +127,6 @@ class QEMUMachine:
name: Optional[str] = None,
base_temp_dir: str = "/var/tmp",
monitor_address: Optional[SocketAddrT] = None,
- sock_dir: Optional[str] = None,
drain_console: bool = False,
console_log: Optional[str] = None,
log_dir: Optional[str] = None,
@@ -141,7 +140,6 @@ class QEMUMachine:
@param name: prefix for socket and log file names (default: qemu-PID)
@param base_temp_dir: default location where temp files are created
@param monitor_address: address for QMP monitor
- @param sock_dir: where to create socket (defaults to base_temp_dir)
@param drain_console: (optional) True to drain console socket to buffer
@param console_log: (optional) path to console log file
@param log_dir: where to create and keep log files
@@ -163,7 +161,6 @@ class QEMUMachine:
Tuple[socket.socket, socket.socket]] = None
self._temp_dir: Optional[str] = None
self._base_temp_dir = base_temp_dir
- self._sock_dir = sock_dir
self._log_dir = log_dir
self._monitor_address = monitor_address
@@ -189,9 +186,6 @@ class QEMUMachine:
self._console_index = 0
self._console_set = False
self._console_device_type: Optional[str] = None
- self._console_address = os.path.join(
- self.sock_dir, f"{self._name}.con"
- )
self._console_socket: Optional[socket.socket] = None
self._console_file: Optional[socket.SocketIO] = None
self._remove_files: List[str] = []
@@ -335,9 +329,6 @@ class QEMUMachine:
return self._args
def _pre_launch(self) -> None:
- if self._console_set:
- self._remove_files.append(self._console_address)
-
if self._qmp_set:
if self._monitor_address is None:
self._sock_pair = socket.socketpair()
@@ -938,15 +929,6 @@ class QEMUMachine:
return self._temp_dir
@property
- def sock_dir(self) -> str:
- """
- Returns the directory used for sockfiles by this machine.
- """
- if self._sock_dir:
- return self._sock_dir
- return self.temp_dir
-
- @property
def log_dir(self) -> str:
"""
Returns a directory to be used for writing logs
diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py
index 8180d3ab01..4f5ede85b2 100644
--- a/python/qemu/machine/qtest.py
+++ b/python/qemu/machine/qtest.py
@@ -135,17 +135,14 @@ class QEMUQtestMachine(QEMUMachine):
wrapper: Sequence[str] = (),
name: Optional[str] = None,
base_temp_dir: str = "/var/tmp",
- sock_dir: Optional[str] = None,
qmp_timer: Optional[float] = None):
# pylint: disable=too-many-arguments
if name is None:
name = "qemu-%d" % os.getpid()
- if sock_dir is None:
- sock_dir = base_temp_dir
super().__init__(binary, args, wrapper=wrapper, name=name,
base_temp_dir=base_temp_dir,
- sock_dir=sock_dir, qmp_timer=qmp_timer)
+ qmp_timer=qmp_timer)
self._qtest: Optional[QEMUQtestProtocol] = None
self._qtest_sock_pair: Optional[
Tuple[socket.socket, socket.socket]] = None