From: Daniel P. Berrangé Date: Tue, 15 Jul 2025 14:30:20 +0000 (+0100) Subject: python: ensure QEMUQtestProtocol closes its socket X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6ccb48ffc19fe25511313a246d4a8bad51114ea9;p=thirdparty%2Fqemu.git python: ensure QEMUQtestProtocol closes its socket While QEMUQtestMachine closes the socket that was passed to QEMUQtestProtocol, the python resource leak manager still believes that the copy QEMUQtestProtocol holds is open. We must explicitly call close to avoid this leak warnnig. Signed-off-by: Daniel P. Berrangé --- diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py index 4f5ede85b23..781f674ffaf 100644 --- a/python/qemu/machine/qtest.py +++ b/python/qemu/machine/qtest.py @@ -177,6 +177,8 @@ class QEMUQtestMachine(QEMUMachine): self._qtest_sock_pair[0].close() self._qtest_sock_pair[1].close() self._qtest_sock_pair = None + if self._qtest is not None: + self._qtest.close() super()._post_shutdown() def qtest(self, cmd: str) -> str: