From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592016; cv=none; d=zohomail.com; s=zohoarc; b=HEPmUOeN3UQc3BtrQWlJv6m96Bie6Zk5lJICze+QreLaNCeynNrYeh66308onhCvVl4HN8q5sGjxb98wlH8wXaZ9tSOS7xRxPrb25zo4/gq+zYTOwWTL6l+gP+CVqCHSsbs4vJHoq+TvSlSQMA3sgxc/dKI4OyFkj6BNLI/27VU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592016; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ddOHlg2I4G80ZNpGJ6XyQHS3S7Yl+ORJLnTM771cj00=; b=na8Ss/W8QvOG9h1U8mpxpzLprdpTSF24oFBgXJ7WoP8JKWEs7o+VYhpgOgBTu3Q2wKNaodpcWI1z76U/sx+vPAxF0jlzCXQv4s1s5k98IcmYKkcDMLLphdGYPtlvh7X/IOuH6xY4I0mhzcTjxSVgMDGdSzH+v5WfmdRr1Tn/orc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592016173519.490882749539; Tue, 15 Jul 2025 08:06:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhEZ-0002yB-0T; Tue, 15 Jul 2025 11:06:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubggL-0003La-HJ for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:31:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubggH-0006Sb-FH for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:30:57 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-313-6DSKuL3rOFyxpNXTIXH3Dg-1; Tue, 15 Jul 2025 10:30:48 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1BF9619560AA; Tue, 15 Jul 2025 14:30:47 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2A144180045B; Tue, 15 Jul 2025 14:30:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ddOHlg2I4G80ZNpGJ6XyQHS3S7Yl+ORJLnTM771cj00=; b=PO/TX0xyxdJHy7HRnxRxa091wwxY7uQwqqGVZx+NmEd9OBkv5pwgib8AkcrNIGPlAIbYcP S0oHCRtXtkFRkJ+41z3fKfDtfyLoHzAKb1VrKPOlR0z5aJlNc8fRWqJbtn4aBJvZ0QtA1E bJp2MqjQLc6JFzK75MyvZlqQESyZ4yU= X-MC-Unique: 6DSKuL3rOFyxpNXTIXH3Dg-1 X-Mimecast-MFC-AGG-ID: 6DSKuL3rOFyxpNXTIXH3Dg_1752589847 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Richard W.M. Jones" Subject: [PATCH 01/14] python: Replace asyncio.get_event_loop for Python 3.14 Date: Tue, 15 Jul 2025 15:30:10 +0100 Message-ID: <20250715143023.1851000-2-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592023329116600 From: Richard W.M. Jones In Python 3.14, no asyncio event loop gets generated automatically. Instead create one when we need it. This should work with Python 3.13 as well. This change was suggested here: https://bugzilla.redhat.com/show_bug.cgi?id=3D2375004#c4 See-also: https://docs.python.org/3.14/whatsnew/3.14.html#id7 Thanks: Miro Hron=C4=8Dok, Daniel P. Berrang=C3=A9 Signed-off-by: Richard W.M. Jones Reviewed-by: John Snow --- python/qemu/qmp/legacy.py | 5 ++++- python/qemu/qmp/qmp_tui.py | 2 +- python/tests/protocol.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python/qemu/qmp/legacy.py b/python/qemu/qmp/legacy.py index 22a2b5616e..e11d05afbd 100644 --- a/python/qemu/qmp/legacy.py +++ b/python/qemu/qmp/legacy.py @@ -86,7 +86,10 @@ def __init__(self, "server argument should be False when passing a socket") =20 self._qmp =3D QMPClient(nickname) - self._aloop =3D asyncio.get_event_loop() + try: + self._aloop =3D asyncio.get_event_loop() + except RuntimeError: + self._aloop =3D asyncio.new_event_loop() self._address =3D address self._timeout: Optional[float] =3D None =20 diff --git a/python/qemu/qmp/qmp_tui.py b/python/qemu/qmp/qmp_tui.py index 2d9ebbd20b..7dfb03c9ad 100644 --- a/python/qemu/qmp/qmp_tui.py +++ b/python/qemu/qmp/qmp_tui.py @@ -377,7 +377,7 @@ def run(self, debug: bool =3D False) -> None: screen =3D urwid.raw_display.Screen() screen.set_terminal_properties(256) =20 - self.aloop =3D asyncio.get_event_loop() + self.aloop =3D asyncio.new_event_loop() self.aloop.set_debug(debug) =20 # Gracefully handle SIGTERM and SIGINT signals diff --git a/python/tests/protocol.py b/python/tests/protocol.py index 56c4d441f9..db5d54d83f 100644 --- a/python/tests/protocol.py +++ b/python/tests/protocol.py @@ -228,7 +228,7 @@ def async_test(async_test_method): Decorator; adds SetUp and TearDown to async tests. """ async def _wrapper(self, *args, **kwargs): - loop =3D asyncio.get_event_loop() + loop =3D asyncio.new_event_loop() loop.set_debug(True) =20 await self._asyncSetUp() --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592530; cv=none; d=zohomail.com; s=zohoarc; b=TjcoTIsK8kYm5ByP+wOHS+H4ATlCLn4/I/PYL+9Ij/i4M6EpYFFZRmqO30DCle+6iPxKorc2F3Wfxukz9wIHqNeHeH3OOQufljIrmGXgm8H4HQKNGJ4UKWGvEhGdMkj/XWLEFbno0TZlP1ydUZxxKVG/4vzq5/6CGNo0BUqsvMw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592530; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=u3PYgrybvikraahXPw5BOhsK8/KePjmHjr8xKzUf4F4=; b=fMwpW61RkW6Tv8jOcZlS0Hau9TczS8BRlRwzmh51PGMmbe5mSCXqCtruAqOrrxYZdALRR/jUCLptTsq2L87wKh6xsbrKk4rTqINelzNtuJ+E8hZMHs8G4AR8dvXt7LBLNwS2x8wLV1snrges0IlwUeQQeq1LAh22Abg1/JPAOqE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592530928632.8823613821838; Tue, 15 Jul 2025 08:15:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhNH-00028V-Ma; Tue, 15 Jul 2025 11:15:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubggX-0003TT-Ph for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:31:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubggT-0006UF-9H for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:31:09 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-594-6hoQWthENkCc5LKE3ZTwfQ-1; Tue, 15 Jul 2025 10:31:01 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E4EC518001D6; Tue, 15 Jul 2025 14:30:59 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8CDCD180045B; Tue, 15 Jul 2025 14:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u3PYgrybvikraahXPw5BOhsK8/KePjmHjr8xKzUf4F4=; b=eE1HPunbBTQYTb+YGqqbdO+7rTAeT8nzbv/nG849aenObONlMJTbvoaXyJHRzluycuj+z4 SSvIw95d+0IfmCz0OGJL8dV6A5M/AiCJOFARmkbwAJXWYenWb6eB/3qiRjAjiQociHguFb vwby3jYVNBHRd3FQd/Dp/g+NWPOU4Y4= X-MC-Unique: 6hoQWthENkCc5LKE3ZTwfQ-1 X-Mimecast-MFC-AGG-ID: 6hoQWthENkCc5LKE3ZTwfQ_1752589860 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 02/14] python: avoid deprecation warning with get_event_loop Date: Tue, 15 Jul 2025 15:30:11 +0100 Message-ID: <20250715143023.1851000-3-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592533803116600 We need to call get_event_loop but have no way of knowing ahead of time whether the current thread has an event loop of not. We can handle a missing event loop, but we need to hide the warning python will emit to avoid tripping up iotests expected output. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Eric Blake Reviewed-by: John Snow --- python/qemu/qmp/legacy.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/qemu/qmp/legacy.py b/python/qemu/qmp/legacy.py index e11d05afbd..c6ab3edc86 100644 --- a/python/qemu/qmp/legacy.py +++ b/python/qemu/qmp/legacy.py @@ -34,6 +34,7 @@ TypeVar, Union, ) +import warnings =20 from .error import QMPError from .protocol import Runstate, SocketAddrT @@ -87,7 +88,11 @@ def __init__(self, =20 self._qmp =3D QMPClient(nickname) try: - self._aloop =3D asyncio.get_event_loop() + with warnings.catch_warnings(): + # Python <=3D 3.13 will trigger deprecation warnings + # if no event loop is set + warnings.simplefilter("ignore") + self._aloop =3D asyncio.get_event_loop() except RuntimeError: self._aloop =3D asyncio.new_event_loop() self._address =3D address --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592066; cv=none; d=zohomail.com; s=zohoarc; b=JzhfKcodERrzbOMK796iQ5LD5mv4VpS9s306HDhCncfy7bUVZ+Q8Tr1J93lYVexpsK2BjjfzkyZIJKiuObia8gaX5SD4s0vzq0ro+qmtQOBT1VTwzyq+MXPMuU79SUjcNpGQayqElEvaumWe6aPffuRPmxlfZXyt0qQE/KnzTcs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592066; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0uaEabOSXUahWV4PiOgoybPYT27qnbN4CDQSPyTIrjg=; b=DcOxtGJDo6dto3YkRgT3PeE6HVqikNoCWaW6seC92i88pjE0gMGq0qXPzPFikCfcJcWubQ0VeJqGgzFdCbj6hCsObtVZduqkG4p8A7OMk0sj1ksNnR/kJ4B2AtSV5pvsa+ULz2biM2aQBAkoFFxxYi8gsxwAdqUosgRR9OqORz0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592066133604.4982330359202; Tue, 15 Jul 2025 08:07:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhFh-0003pZ-WE; Tue, 15 Jul 2025 11:07:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubggh-0003Wm-D3 for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:31:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubgge-0006Vn-Ot for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:31:19 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-169-kAN5Qq7EMWWx49prYtkJjA-1; Tue, 15 Jul 2025 10:31:09 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 54861195608F; Tue, 15 Jul 2025 14:31:04 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 82D8F18002B1; Tue, 15 Jul 2025 14:31:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0uaEabOSXUahWV4PiOgoybPYT27qnbN4CDQSPyTIrjg=; b=Rb0R3P/GDUL7XOSD5hDWcsyUlqEEzAY/44E3ccYXCadA3y8LuJLakln39Jtp/Ds4c8GPLP KCJugtwR1SnGIw8CeU62qcO1n7PVxyMRvqgMBzWX2+P3un0nnJjVe75X3zTdDiVElVprdo AIcF4V5oCgu9IvbAm8p9ePEUa+Jyr1E= X-MC-Unique: kAN5Qq7EMWWx49prYtkJjA-1 X-Mimecast-MFC-AGG-ID: kAN5Qq7EMWWx49prYtkJjA_1752589864 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 03/14] python: drop 'is_closing' back compat helper Date: Tue, 15 Jul 2025 15:30:12 +0100 Message-ID: <20250715143023.1851000-4-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592067043116601 Our minimum python is now 3.9, so back compat with python 3.6 is no longer required. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: John Snow --- python/qemu/qmp/protocol.py | 3 +-- python/qemu/qmp/util.py | 16 ---------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/python/qemu/qmp/protocol.py b/python/qemu/qmp/protocol.py index a4ffdfad51..9a7ada4a1e 100644 --- a/python/qemu/qmp/protocol.py +++ b/python/qemu/qmp/protocol.py @@ -39,7 +39,6 @@ create_task, exception_summary, flush, - is_closing, pretty_traceback, upper_half, wait_closed, @@ -825,7 +824,7 @@ async def _bh_close_stream(self, error_pathway: bool = =3D False) -> None: if not self._writer: return =20 - if not is_closing(self._writer): + if not self._writer.is_closing(): self.logger.debug("Closing StreamWriter.") self._writer.close() =20 diff --git a/python/qemu/qmp/util.py b/python/qemu/qmp/util.py index ca6225e9cd..39fc341f2f 100644 --- a/python/qemu/qmp/util.py +++ b/python/qemu/qmp/util.py @@ -104,22 +104,6 @@ def create_task(coro: Coroutine[Any, Any, T], return asyncio.ensure_future(coro, loop=3Dloop) =20 =20 -def is_closing(writer: asyncio.StreamWriter) -> bool: - """ - Python 3.6-compatible `asyncio.StreamWriter.is_closing` wrapper. - - :param writer: The `asyncio.StreamWriter` object. - :return: `True` if the writer is closing, or closed. - """ - if sys.version_info >=3D (3, 7): - return writer.is_closing() - - # Python 3.6: - transport =3D writer.transport - assert isinstance(transport, asyncio.WriteTransport) - return transport.is_closing() - - async def wait_closed(writer: asyncio.StreamWriter) -> None: """ Python 3.6-compatible `asyncio.StreamWriter.wait_closed` wrapper. --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592072; cv=none; d=zohomail.com; s=zohoarc; b=LH9cpzZzKv1Ei7n5+Rrcl5g/vtMVhWrTla1h7Rk2GFBcSZEmOmrgHT5iT8zqCQJ8x1+j1FoO/fAPJ8wjxfiuQXok28+RIyqGj0Wk3Y5+jwfxyzYzZN4vmTK2J1tdvKBUfHwSQqMVL2X0fD/9RMjGXeumuGO+5AEmTiyDhdT90As= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592072; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5JPC+kbOWzUd5lzM486OiMcy9RbtJKSJFRN42oWXHNo=; b=lkUWdXbvb7gzwRf3KQJrNi2i2Y1+DMk+RJl8R/8fdertmTMvD59MVd1Qh89iJSeqbsI0DpGNvGyKg3qgEoXHKL04XSk093N9gBAMADyAzJAyAWKWY8uY7Y7vJe4uDRH8xYJIL5T05DeHlROyMp5bQ+9KwZ7drJFrrGol13OsBaI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592072425359.2308121411014; Tue, 15 Jul 2025 08:07:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhFm-0003yf-8J; Tue, 15 Jul 2025 11:07:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubggq-0003Zb-8f for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:31:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubggn-0006Wm-6P for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:31:28 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-613-ual90419OAS7DsHsRexILw-1; Tue, 15 Jul 2025 10:31:14 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3C1D419560B6; Tue, 15 Jul 2025 14:31:13 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2BB5118002B1; Tue, 15 Jul 2025 14:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5JPC+kbOWzUd5lzM486OiMcy9RbtJKSJFRN42oWXHNo=; b=AVt8YFiMO0INQRy/CU+gdEbMXodmo7GZYBARt/OuPD7hCxdiF7zrSRqJIXWFyBKCa/ICft d3MOFt+DAQiLcxA1yZk+BYteKZGfk688z02M744PlNIgrAsAhcclyUJdBbztVvWzrGq/1b iJb0b+ca9wrxzHRQ1NeVbFSNUMX1Ud8= X-MC-Unique: ual90419OAS7DsHsRexILw-1 X-Mimecast-MFC-AGG-ID: ual90419OAS7DsHsRexILw_1752589873 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 04/14] python: drop 'wait_closed' back compat helper Date: Tue, 15 Jul 2025 15:30:13 +0100 Message-ID: <20250715143023.1851000-5-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592075092116600 Our minimum python is now 3.9, so back compat with python 3.6 is no longer required. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Snow --- python/qemu/qmp/protocol.py | 3 +-- python/qemu/qmp/util.py | 29 ----------------------------- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/python/qemu/qmp/protocol.py b/python/qemu/qmp/protocol.py index 9a7ada4a1e..deb6b20d29 100644 --- a/python/qemu/qmp/protocol.py +++ b/python/qemu/qmp/protocol.py @@ -41,7 +41,6 @@ flush, pretty_traceback, upper_half, - wait_closed, ) =20 =20 @@ -830,7 +829,7 @@ async def _bh_close_stream(self, error_pathway: bool = =3D False) -> None: =20 self.logger.debug("Waiting for StreamWriter to close ...") try: - await wait_closed(self._writer) + await self._writer.wait_closed() except Exception: # pylint: disable=3Dbroad-except # It's hard to tell if the Stream is already closed or # not. Even if one of the tasks has failed, it may have diff --git a/python/qemu/qmp/util.py b/python/qemu/qmp/util.py index 39fc341f2f..b5e9750576 100644 --- a/python/qemu/qmp/util.py +++ b/python/qemu/qmp/util.py @@ -104,35 +104,6 @@ def create_task(coro: Coroutine[Any, Any, T], return asyncio.ensure_future(coro, loop=3Dloop) =20 =20 -async def wait_closed(writer: asyncio.StreamWriter) -> None: - """ - Python 3.6-compatible `asyncio.StreamWriter.wait_closed` wrapper. - - :param writer: The `asyncio.StreamWriter` to wait on. - """ - if sys.version_info >=3D (3, 7): - await writer.wait_closed() - return - - # Python 3.6 - transport =3D writer.transport - assert isinstance(transport, asyncio.WriteTransport) - - while not transport.is_closing(): - await asyncio.sleep(0) - - # This is an ugly workaround, but it's the best I can come up with. - sock =3D transport.get_extra_info('socket') - - if sock is None: - # Our transport doesn't have a socket? ... - # Nothing we can reasonably do. - return - - while sock.fileno() !=3D -1: - await asyncio.sleep(0) - - def asyncio_run(coro: Coroutine[Any, Any, T], *, debug: bool =3D False) ->= T: """ Python 3.6-compatible `asyncio.run` wrapper. --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592065; cv=none; d=zohomail.com; s=zohoarc; b=jStDNhq+gPsPuFyugxPJHZEHrb861V1zez0Op7QS8IlfHZ5Y3yb61lSFMpdehouAhQSLLUiHvJbQ/ppxgx4JdV2A3YoHxxdTWHdz/RcBvSfQHyDF97f72zZxQDNNAS6qJxzZZ7srP++tEy97Q9sxgAIn9pJL5MykRWJlZfGYHa0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592065; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HougeRGUQoKQWzLFt3pBzu7NGeq3jnotTER3D67Tr4A=; b=M54ANbIwcSPkLMLxWvQTg9yNJevcPRyEXBS8w5VHzBl1JPBgg8hk5h9uViQjhhThuSe33pFllBEsYPTNzU2WCmXDBksFoqm/vEgrKyUHVQN399AgmYmILfnCVhHRZx7bXzUTrFhIXG2K4x5JzfXy0rnHG6LrCgL36qQyyrOSRhE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592065418686.1221048494592; Tue, 15 Jul 2025 08:07:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhFo-00045J-Ny; Tue, 15 Jul 2025 11:07:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubgh4-0003lT-V7 for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:31:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubggw-0006Y1-7d for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:31:42 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-yhLrqXfINQWZMktQr2q9gQ-1; Tue, 15 Jul 2025 10:31:29 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0A0F1195608A; Tue, 15 Jul 2025 14:31:28 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 65E9E180035C; Tue, 15 Jul 2025 14:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HougeRGUQoKQWzLFt3pBzu7NGeq3jnotTER3D67Tr4A=; b=S9GGGJ89O2sXW15YVDH1SS6l6ovT+zjH0nxPhVPl+4cnEcgoK+5m+mA8lS2529w3Dhc+ve 8f9pXINl9GgoX3lkDc2mceVlPi08nPMtrRtBDYfrr41VdyRHcOQb+ySfGR5WrnKfywkoRp XesdOaKMMD6Y412Ov0OY7xn6xFWk+Xk= X-MC-Unique: yhLrqXfINQWZMktQr2q9gQ-1 X-Mimecast-MFC-AGG-ID: yhLrqXfINQWZMktQr2q9gQ_1752589888 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 05/14] python: drop 'asyncio_run' back compat helper Date: Tue, 15 Jul 2025 15:30:14 +0100 Message-ID: <20250715143023.1851000-6-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592067043116600 Our minimum python is now 3.9, so back compat with python 3.6 is no longer required. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Snow --- python/qemu/qmp/util.py | 19 ------------------- python/tests/protocol.py | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/python/qemu/qmp/util.py b/python/qemu/qmp/util.py index b5e9750576..7f9e718154 100644 --- a/python/qemu/qmp/util.py +++ b/python/qemu/qmp/util.py @@ -104,25 +104,6 @@ def create_task(coro: Coroutine[Any, Any, T], return asyncio.ensure_future(coro, loop=3Dloop) =20 =20 -def asyncio_run(coro: Coroutine[Any, Any, T], *, debug: bool =3D False) ->= T: - """ - Python 3.6-compatible `asyncio.run` wrapper. - - :param coro: A coroutine to execute now. - :return: The return value from the coroutine. - """ - if sys.version_info >=3D (3, 7): - return asyncio.run(coro, debug=3Ddebug) - - # Python 3.6 - loop =3D asyncio.get_event_loop() - loop.set_debug(debug) - ret =3D loop.run_until_complete(coro) - loop.close() - - return ret - - # ---------------------------- # Section: Logging & Debugging # ---------------------------- diff --git a/python/tests/protocol.py b/python/tests/protocol.py index db5d54d83f..4a0ee94727 100644 --- a/python/tests/protocol.py +++ b/python/tests/protocol.py @@ -8,7 +8,7 @@ =20 from qemu.qmp import ConnectError, Runstate from qemu.qmp.protocol import AsyncProtocol, StateError -from qemu.qmp.util import asyncio_run, create_task +from qemu.qmp.util import create_task =20 =20 class NullProtocol(AsyncProtocol[None]): --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592541; cv=none; d=zohomail.com; s=zohoarc; b=CN3Wd4Yb81n1ygVElED0n6f6KusbUqcI4FeOQEdxNMSn5AtlYV1kG+c7rwuK9fXCaA9871Gm6n5+TxSCpD4YyL9iY9p7I8x+NCxNnxQw7lPSUIjOWu4m6nicWm3leIrpiq0w13ohkWNjl51YudN9fSo33UMJ77s/vImPf2q3rqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592541; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s5pK3tmmYGTqFklFHKc6zkczYKsDiNwcJN04/F3hJC4=; b=Zjlm1GDvOHdkX+t7lbDleaDnF/kmzmXFQL+8ZG6USb+N2GrhaIlrgW2VWFVf+l6ycFktN0wP1+H9MsjFau5pJQZIgA5Fg68ak1t3Oo3neHhxmFt/Cp8VCoDmPBhXN3Dykq8OgTdzYh6rxi2H9dR0O2Rzs6Gkg1LBdkieaNpaOt0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592541330517.3223853953268; Tue, 15 Jul 2025 08:15:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhNN-0002Kj-MV; Tue, 15 Jul 2025 11:15:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghD-0003rW-Ku for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:31:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghA-0006ZT-Gj for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:31:51 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-542-ki2Ab1RFNVa48N7eXlTdcg-1; Tue, 15 Jul 2025 10:31:44 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AE46C1958B0F; Tue, 15 Jul 2025 14:31:41 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A87E2180045B; Tue, 15 Jul 2025 14:31:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s5pK3tmmYGTqFklFHKc6zkczYKsDiNwcJN04/F3hJC4=; b=B3juwIP7QC1Bf8h3sO+1AuWmJKaZ4QkRj0vqxuXoC4P1cMinWbrSz5v7LCEnTlHhOl90Xz I0kz2hCvPUzpLKsKeiohYQxArAHdZvOhZCRosiGkraHIcA+n64w4y4FEzUuDaddNZJBkXO U6FgOqigDjVT+iZTeSIzzl3x6+rV0hU= X-MC-Unique: ki2Ab1RFNVa48N7eXlTdcg-1 X-Mimecast-MFC-AGG-ID: ki2Ab1RFNVa48N7eXlTdcg_1752589901 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 06/14] python: drop 'create_task' back compat helper Date: Tue, 15 Jul 2025 15:30:15 +0100 Message-ID: <20250715143023.1851000-7-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592543941116600 Our minimum python is now 3.9, so back compat with python 3.6 is no longer required. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Snow --- python/qemu/qmp/protocol.py | 7 +++---- python/qemu/qmp/qmp_tui.py | 8 ++++---- python/qemu/qmp/util.py | 33 +-------------------------------- python/tests/protocol.py | 7 +++---- 4 files changed, 11 insertions(+), 44 deletions(-) diff --git a/python/qemu/qmp/protocol.py b/python/qemu/qmp/protocol.py index deb6b20d29..4aff0ea423 100644 --- a/python/qemu/qmp/protocol.py +++ b/python/qemu/qmp/protocol.py @@ -36,7 +36,6 @@ from .error import QMPError from .util import ( bottom_half, - create_task, exception_summary, flush, pretty_traceback, @@ -661,8 +660,8 @@ async def _establish_session(self) -> None: reader_coro =3D self._bh_loop_forever(self._bh_recv_message, 'Read= er') writer_coro =3D self._bh_loop_forever(self._bh_send_message, 'Writ= er') =20 - self._reader_task =3D create_task(reader_coro) - self._writer_task =3D create_task(writer_coro) + self._reader_task =3D asyncio.create_task(reader_coro) + self._writer_task =3D asyncio.create_task(writer_coro) =20 self._bh_tasks =3D asyncio.gather( self._reader_task, @@ -687,7 +686,7 @@ def _schedule_disconnect(self) -> None: if not self._dc_task: self._set_state(Runstate.DISCONNECTING) self.logger.debug("Scheduling disconnect.") - self._dc_task =3D create_task(self._bh_disconnect()) + self._dc_task =3D asyncio.create_task(self._bh_disconnect()) =20 @upper_half async def _wait_disconnect(self) -> None: diff --git a/python/qemu/qmp/qmp_tui.py b/python/qemu/qmp/qmp_tui.py index 7dfb03c9ad..61e8b3773c 100644 --- a/python/qemu/qmp/qmp_tui.py +++ b/python/qemu/qmp/qmp_tui.py @@ -40,7 +40,7 @@ from .message import DeserializationError, Message, UnexpectedTypeError from .protocol import ConnectError, Runstate from .qmp_client import ExecInterruptedError, QMPClient -from .util import create_task, pretty_traceback +from .util import pretty_traceback =20 =20 # The name of the signal that is used to update the history list @@ -225,7 +225,7 @@ def cb_send_to_server(self, raw_msg: str) -> None: """ try: msg =3D Message(bytes(raw_msg, encoding=3D'utf-8')) - create_task(self._send_to_server(msg)) + asyncio.create_task(self._send_to_server(msg)) except (DeserializationError, UnexpectedTypeError) as err: raw_msg =3D format_json(raw_msg) logging.info('Invalid message: %s', err.error_message) @@ -246,7 +246,7 @@ def kill_app(self) -> None: Initiates killing of app. A bridge between asynchronous and synchr= onous code. """ - create_task(self._kill_app()) + asyncio.create_task(self._kill_app()) =20 async def _kill_app(self) -> None: """ @@ -393,7 +393,7 @@ def run(self, debug: bool =3D False) -> None: handle_mouse=3DTrue, event_loop=3Devent_loop) =20 - create_task(self.manage_connection(), self.aloop) + self.aloop.create_task(self.manage_connection()) try: main_loop.run() except Exception as err: diff --git a/python/qemu/qmp/util.py b/python/qemu/qmp/util.py index 7f9e718154..c44a5aacbc 100644 --- a/python/qemu/qmp/util.py +++ b/python/qemu/qmp/util.py @@ -13,13 +13,7 @@ import asyncio import sys import traceback -from typing import ( - Any, - Coroutine, - Optional, - TypeVar, - cast, -) +from typing import TypeVar, cast =20 =20 T =3D TypeVar('T') @@ -79,31 +73,6 @@ def bottom_half(func: T) -> T: return func =20 =20 -# ------------------------------- -# Section: Compatibility Wrappers -# ------------------------------- - - -def create_task(coro: Coroutine[Any, Any, T], - loop: Optional[asyncio.AbstractEventLoop] =3D None - ) -> 'asyncio.Future[T]': - """ - Python 3.6-compatible `asyncio.create_task` wrapper. - - :param coro: The coroutine to execute in a task. - :param loop: Optionally, the loop to create the task in. - - :return: An `asyncio.Future` object. - """ - if sys.version_info >=3D (3, 7): - if loop is not None: - return loop.create_task(coro) - return asyncio.create_task(coro) # pylint: disable=3Dno-member - - # Python 3.6: - return asyncio.ensure_future(coro, loop=3Dloop) - - # ---------------------------- # Section: Logging & Debugging # ---------------------------- diff --git a/python/tests/protocol.py b/python/tests/protocol.py index 4a0ee94727..9bb23b6a7b 100644 --- a/python/tests/protocol.py +++ b/python/tests/protocol.py @@ -8,7 +8,6 @@ =20 from qemu.qmp import ConnectError, Runstate from qemu.qmp.protocol import AsyncProtocol, StateError -from qemu.qmp.util import create_task =20 =20 class NullProtocol(AsyncProtocol[None]): @@ -124,7 +123,7 @@ async def _runner(): if allow_cancellation: return raise - return create_task(_runner()) + return asyncio.create_task(_runner()) =20 =20 @contextmanager @@ -271,7 +270,7 @@ async def _watcher(): msg=3Df"Expected state '{state.name}'", ) =20 - self.runstate_watcher =3D create_task(_watcher()) + self.runstate_watcher =3D asyncio.create_task(_watcher()) # Kick the loop and force the task to block on the event. await asyncio.sleep(0) =20 @@ -589,7 +588,7 @@ async def _asyncTearDown(self): async def testSmoke(self): with TemporaryDirectory(suffix=3D'.qmp') as tmpdir: sock =3D os.path.join(tmpdir, type(self.proto).__name__ + ".so= ck") - server_task =3D create_task(self.server.start_server_and_accep= t(sock)) + server_task =3D asyncio.create_task(self.server.start_server_a= nd_accept(sock)) =20 # give the server a chance to start listening [...] await asyncio.sleep(0) --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592363; cv=none; d=zohomail.com; s=zohoarc; b=KUmj7zpbPTaX82UKnKr2mkBwFYQVmQUXFqt42edXqHAum2frqkLWEtUkfoJ8XEZdZTtAL8nPjS2RA6yR2qjADJ6wYRt6emey5LTkWuHzevKHGmRO5nKAimTKvxUCnVFq0OfbvjWLPfnHqVIG7TrCURNWVueBes1U8usujF+AAd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592363; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7C9TDfjv0fk+Q560faBXLH2CfJ8fnSy6oFTIz7jMlPI=; b=gXCNjxlcrk/tHMr28JcEV5R4BFNy3PzmQD0jeojTKOj8dqON32rt5bIK7KINopUwnmc+NerUg/Z4kwSogxSvT8yrOSoMM0fNNa/H1L5FP3S4BEOUZ45mLd1saDjShf6WewUhYF6n7blDJRMkYZV4V8caHc3shI1d85EozRP9048= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592363164961.7238291810761; Tue, 15 Jul 2025 08:12:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhGV-0005bI-Hf; Tue, 15 Jul 2025 11:08:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghX-0003wy-DT for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghS-0006b4-5q for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:11 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-193-i09sd1zNM_KEaWA-emlsRg-1; Tue, 15 Jul 2025 10:31:57 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B47C7180ACC1; Tue, 15 Jul 2025 14:31:50 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BBC1918002B3; Tue, 15 Jul 2025 14:31:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7C9TDfjv0fk+Q560faBXLH2CfJ8fnSy6oFTIz7jMlPI=; b=Gni1Sw9fKk19DKTahCdlws2q0q3oRUtW0LHqPUHRgBQ6uQEFSPcsFo7yyBBJBwhSc2zg4x 1C32qGbPY8LOgYpg3DyHNlJK73rlyUb8ykVyRQhNxMks+JJqaTr4yf15pmHtLNiKeT++Sb 754mcKVem2BLrMEr2eNs6ssFvMV2NXk= X-MC-Unique: i09sd1zNM_KEaWA-emlsRg-1 X-Mimecast-MFC-AGG-ID: i09sd1zNM_KEaWA-emlsRg_1752589916 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 07/14] iotests: drop compat for old version context manager Date: Tue, 15 Jul 2025 15:30:16 +0100 Message-ID: <20250715143023.1851000-8-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592364719116600 Our minimum python is now 3.9, so back compat with prior python versions is no longer required. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Snow --- tests/qemu-iotests/testenv.py | 7 ++----- tests/qemu-iotests/testrunner.py | 9 ++------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 6326e46b7b..29caaa8a34 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -22,15 +22,12 @@ from pathlib import Path import shutil import collections +import contextlib import random import subprocess import glob from typing import List, Dict, Any, Optional =20 -if sys.version_info >=3D (3, 9): - from contextlib import AbstractContextManager as ContextManager -else: - from typing import ContextManager =20 DEF_GDB_OPTIONS =3D 'localhost:12345' =20 @@ -58,7 +55,7 @@ def get_default_machine(qemu_prog: str) -> str: return default_machine =20 =20 -class TestEnv(ContextManager['TestEnv']): +class TestEnv(contextlib.AbstractContextManager['TestEnv']): """ Manage system environment for running tests =20 diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunn= er.py index 2e236c8fa3..14cc8492f9 100644 --- a/tests/qemu-iotests/testrunner.py +++ b/tests/qemu-iotests/testrunner.py @@ -30,11 +30,6 @@ from typing import List, Optional, Any, Sequence, Dict from testenv import TestEnv =20 -if sys.version_info >=3D (3, 9): - from contextlib import AbstractContextManager as ContextManager -else: - from typing import ContextManager - =20 def silent_unlink(path: Path) -> None: try: @@ -57,7 +52,7 @@ def file_diff(file1: str, file2: str) -> List[str]: return res =20 =20 -class LastElapsedTime(ContextManager['LastElapsedTime']): +class LastElapsedTime(contextlib.AbstractContextManager['LastElapsedTime']= ): """ Cache for elapsed time for tests, to show it during new test run =20 It is safe to use get() at any time. To use update(), you must either @@ -112,7 +107,7 @@ def __init__(self, status: str, description: str =3D '', self.interrupted =3D interrupted =20 =20 -class TestRunner(ContextManager['TestRunner']): +class TestRunner(contextlib.AbstractContextManager['TestRunner']): shared_self =3D None =20 @staticmethod --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592435; cv=none; d=zohomail.com; s=zohoarc; b=D92Ue09n1RLrR+M8lbBZomuIlizgaDNBued4hfBfl93irMhtT+tWK6beo8P3RWygSvR/3vHPRSNsyN2lW565atA2qSx4WQVe5bMxAPESTGZIVYZlABspsqJo5E9l0c60cHvcDoCtc8rM8g1frZOGYnogduphi2bta0f3uU9NHbg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592435; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IZ3foe1ZhYVOU+EUTtxX2+V2nOzECffCYWtzlONizqo=; b=BH5UjwC3017p8nHMLmEws/K6zb5ju3Ai5TEjGynI/Y/rIg4y+zMvKBvu1FQC4APlzVDPefrofy4KK3b/jNkU8AywQsPtoiWH5E5aMbtzIhXkol8Cai2clwjVBk74bjTahWWRhSv188HyiiGify8Hx+eca0hguFE3EsYcNCkq07Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592435711864.6457420681853; Tue, 15 Jul 2025 08:13:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhGx-0005yS-V7; Tue, 15 Jul 2025 11:08:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghZ-0003zM-PL for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghT-0006bW-8Q for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:13 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-370-1t56j7CSPpGy3ragLQ2WbQ-1; Tue, 15 Jul 2025 10:32:01 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4063F18001DF; Tue, 15 Jul 2025 14:32:00 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BAA34180045B; Tue, 15 Jul 2025 14:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IZ3foe1ZhYVOU+EUTtxX2+V2nOzECffCYWtzlONizqo=; b=hkO4ue4UqruV6mE4/sx46fiCMFxt91mzaaN7/xSEpCvRpxdbbrPQ0le9ZseU6UpxAJ+zBu CQwv1MuucjofVV2tRgOfKiQtoc5NE9E52QWcjUcCpIoChhcYivernZjgMJYqCTzdBm9kl5 NacTTEXr6OlPisk79VryjgUskSl4nPM= X-MC-Unique: 1t56j7CSPpGy3ragLQ2WbQ-1 X-Mimecast-MFC-AGG-ID: 1t56j7CSPpGy3ragLQ2WbQ_1752589920 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 08/14] functional: ensure log handlers are closed Date: Tue, 15 Jul 2025 15:30:17 +0100 Message-ID: <20250715143023.1851000-9-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592438399116600 This avoids a resource leak warning from python when the log handler is garbage collected. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Thomas Huth --- tests/functional/qemu_test/testcase.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu= _test/testcase.py index 2082c6fce4..71c7160adc 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -232,6 +232,7 @@ def tearDown(self): self.socketdir =3D None self.machinelog.removeHandler(self._log_fh) self.log.removeHandler(self._log_fh) + self._log_fh.close() =20 def main(): path =3D os.path.basename(sys.argv[0])[:-3] @@ -399,4 +400,5 @@ def tearDown(self): for vm in self._vms.values(): vm.shutdown() logging.getLogger('console').removeHandler(self._console_log_fh) + self._console_log_fh.close() super().tearDown() --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592097; cv=none; d=zohomail.com; s=zohoarc; b=BlBGI4hinT2oyP0qGhP7a632+ECIp4MDYv9Nz8i/C5lDoCWgRCTb//rDNfcXQohZDnPuHyEyLLFItUHlxnSx5J4MaRx8HZ9PFi0snIi0saOWHlPog9vFNj3IMyPsmf6Q23Bgdt4UUaLtrl1m6zs+/Dp55ot2fiAOVxEAbrihiqk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592097; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yzYihAHi2LaQQcUUG8xQC4gjom5PyI+zMgH+7AFzw2s=; b=C3Bhmbii8iphcqzv6A+PH+bVdDhHhLPZk8jaDT8H9jxrC9cznBm8N6p792lUUiEiPXKNCbTmht0TZXS7rAArF2bN2mLbT6LL7x5RacPAamqhWQzjD5JSNMYbnXvxl2PNpiP8fIgyVHHkMzf8JHLqc7wUc+aSI6P09FKoGNJmkuY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592097836895.1030734895999; Tue, 15 Jul 2025 08:08:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhG7-0004Wj-ET; Tue, 15 Jul 2025 11:07:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghc-0003zY-UY for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghb-0006ch-1Y for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:16 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-463-VNPeAuLVMm-cgaaPQdMsmA-1; Tue, 15 Jul 2025 10:32:09 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9DD3D19560A2; Tue, 15 Jul 2025 14:32:07 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ECFEE180045B; Tue, 15 Jul 2025 14:32:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yzYihAHi2LaQQcUUG8xQC4gjom5PyI+zMgH+7AFzw2s=; b=Sm79a5JCf8XkFIMGdME88vNtfdwKHU1RHMDTxkusq3HJof5399Er+ynnTS92QV15TpxkgW azsgPuDNDiUu7ji2eUQN+3umaK/gD6BQUEyqhcJvkLaDqIT253ISp8JRBYM990VnNVj/D0 F4V3GDSwiBdz85MQXT+QTWzTXHRL8ok= X-MC-Unique: VNPeAuLVMm-cgaaPQdMsmA-1 X-Mimecast-MFC-AGG-ID: VNPeAuLVMm-cgaaPQdMsmA_1752589927 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 09/14] functional: ensure sockets and files are closed Date: Tue, 15 Jul 2025 15:30:18 +0100 Message-ID: <20250715143023.1851000-10-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592099268116600 The multiprocess and virtio_gpu tests open sockets but then forget to close them, which triggers resource leak warnings The virtio_gpu test also fails to close a log file it opens. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Thomas Huth --- tests/functional/test_multiprocess.py | 3 +++ tests/functional/test_virtio_gpu.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/tests/functional/test_multiprocess.py b/tests/functional/test_= multiprocess.py index 751cf10e63..92d5207b0e 100755 --- a/tests/functional/test_multiprocess.py +++ b/tests/functional/test_multiprocess.py @@ -83,6 +83,9 @@ def do_test(self, kernel_asset, initrd_asset, 'cat /sys/bus/pci/devices/*/ueve= nt', 'PCI_ID=3D1000:0012') =20 + proxy_sock.close() + remote_sock.close() + def test_multiprocess(self): kernel_command_line =3D self.KERNEL_COMMON_COMMAND_LINE if self.arch =3D=3D 'x86_64': diff --git a/tests/functional/test_virtio_gpu.py b/tests/functional/test_vi= rtio_gpu.py index 81c9156d63..be96de24da 100755 --- a/tests/functional/test_virtio_gpu.py +++ b/tests/functional/test_virtio_gpu.py @@ -108,6 +108,7 @@ def test_vhost_user_vga_virgl(self): shell=3DFalse, close_fds=3DFalse, ) + self._vug_log_file.close() =20 self.vm.set_console() self.vm.add_args("-cpu", "host") @@ -135,6 +136,7 @@ def test_vhost_user_vga_virgl(self): "features: +virgl +edid") self.vm.shutdown() qemu_sock.close() + vug_sock.close() vugp.terminate() vugp.wait() =20 --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592164; cv=none; d=zohomail.com; s=zohoarc; b=n1SRKNtlNcY6j5pvnlk3frvKMCE/EyCPyuOVwQgxephEBESrqRz1VjuL3W25DeLfyuUclwC/QT7t0qHF5aIPx3Au6EXf90V8qCXLUJzuPsklLE/fsAwbyqH9NpiqMzoWYCR0O79GHXRdfc1A/sk8qX7Lh3zA8zE7K35HHm23pwk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592164; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KSle7fmy+vVFhATV28bZBJGWiANtWGR7f5f28vUmuF0=; b=XtXzhIxA64KX42hn7d+w6dRlQA9xlZLNW8J+l/lbAa/BRne0zWl2/e5PIQanIuQlOLwqeehApYiUnT8ncmzfWeNAgfEAElHnhsQghxOXJqe4uAvw62+rcHfhC+Lx6wR4CxRkQcLE/FLsI4NFlpVTE096Y8435iDBhnGMrmNAISw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592164510468.5521351297317; Tue, 15 Jul 2025 08:09:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhGX-0005eg-9g; Tue, 15 Jul 2025 11:08:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghd-0003zZ-2Z for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghb-0006cq-8j for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:16 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-313-NDh8E0AXMxap7LUs2iaJow-1; Tue, 15 Jul 2025 10:32:12 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 72DAE1800BCA; Tue, 15 Jul 2025 14:32:11 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0D7BA180035C; Tue, 15 Jul 2025 14:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KSle7fmy+vVFhATV28bZBJGWiANtWGR7f5f28vUmuF0=; b=Rkq/IVz0bbLivvjP+qgoQ9z475w6qJNq9DBfQ1xalNkxWw5AAxisPkMqD7zVacEr+lEO4l U68N954CN/6dzmSqOQxr0IxmgT63CB/1uRwx+uFC1ReMM0t57d8/YDDrXCjWPXq32bDNyL JhM5VSw7vy1s/e/JboB0owbjPjK4A10= X-MC-Unique: NDh8E0AXMxap7LUs2iaJow-1 X-Mimecast-MFC-AGG-ID: NDh8E0AXMxap7LUs2iaJow_1752589931 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 10/14] functional: always enable all python warnings Date: Tue, 15 Jul 2025 15:30:19 +0100 Message-ID: <20250715143023.1851000-11-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592166212116600 Of most importance is that this gives us a heads-up if anything we rely on has been deprecated. The default python behaviour only emits a warning if triggered from __main__ which is very limited. Setting the env variable further ensures that any python child processes will also display warnings. Signed-off-by: Daniel P. Berrang=C3=A9 Acked-by: Thomas Huth --- tests/functional/qemu_test/testcase.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu= _test/testcase.py index 71c7160adc..2a78e735f1 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -19,6 +19,7 @@ from subprocess import run import sys import tempfile +import warnings import unittest import uuid =20 @@ -235,6 +236,9 @@ def tearDown(self): self._log_fh.close() =20 def main(): + warnings.simplefilter("default") + os.environ["PYTHONWARNINGS"] =3D "default" + path =3D os.path.basename(sys.argv[0])[:-3] =20 cache =3D os.environ.get("QEMU_TEST_PRECACHE", None) --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592160; cv=none; d=zohomail.com; s=zohoarc; b=U/bRs3Xy1L7qUVNdMhtLMEZAOrGiBqsCxFBoRH+NOw2wGJPdoF58ijRyvMAKnH0ODPbJSZz1wxPbiFZjzXZ0rBLf2ijBvGYm8VnTTs6K18rdQ4kZBdnea0RDs8VKwjEC9TUdEsPCgAugBQNvGv33EkKBh+Tvp8i9qi/wWdhh/9U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592160; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=50ZHMalesOGXpYlUOhm7AiPK+GGSys9MYdfNXeEZNC4=; b=goKF799MKykGdYnm1NyL5a5oulDZtEED7sudlWS3+1B/TDkb9/dQ49X3qjKvTPGjDlAa7DwzOlTFveD64AECe5zZqHMRpJ+YUT1A+pFuzEVQBsL6ku8+st0xgMkzLJl42UWO+Bz6b7Yo5Xe4hDikb4TH+A6lqxzrXEvhwCbaxmw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592160849359.0091274810146; Tue, 15 Jul 2025 08:09:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhH6-0006MS-Ak; Tue, 15 Jul 2025 11:08:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghk-000417-8k for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghi-0006dZ-GK for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:24 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-421-6NAWR6NnM3mMjX3kwAmVKw-1; Tue, 15 Jul 2025 10:32:17 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0E4C6195609E; Tue, 15 Jul 2025 14:32:16 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0EE97180045B; Tue, 15 Jul 2025 14:32:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=50ZHMalesOGXpYlUOhm7AiPK+GGSys9MYdfNXeEZNC4=; b=eWFsJr3dkvFbZTC6ElHZWoZAuH5IlefLXiZJY9K+3rfg9WYDyG0HfNe4/PjNqe2IA1o6ZM QX2d1gyRIrt9g4nKz3DqyhW4PxXx+BiapwnUkBb8IGJikcT8umLq3E8zigmNYSlg5N2coo ObhoU4yFUE9+TlG2zoKdWz++hl8FkRk= X-MC-Unique: 6NAWR6NnM3mMjX3kwAmVKw-1 X-Mimecast-MFC-AGG-ID: 6NAWR6NnM3mMjX3kwAmVKw_1752589936 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 11/14] python: ensure QEMUQtestProtocol closes its socket Date: Tue, 15 Jul 2025 15:30:20 +0100 Message-ID: <20250715143023.1851000-12-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592162309116600 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=C3=A9 Reviewed-by: John Snow --- python/qemu/machine/qtest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py index 4f5ede85b2..781f674ffa 100644 --- a/python/qemu/machine/qtest.py +++ b/python/qemu/machine/qtest.py @@ -177,6 +177,8 @@ def _post_shutdown(self) -> None: self._qtest_sock_pair[0].close() self._qtest_sock_pair[1].close() self._qtest_sock_pair =3D None + if self._qtest is not None: + self._qtest.close() super()._post_shutdown() =20 def qtest(self, cmd: str) -> str: --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592132; cv=none; d=zohomail.com; s=zohoarc; b=NhdcDBOfOAdNjf1epxURtohQHj7EkBYH4UdoikDoR4hope1SnH/j60dKxTQ60tnxMnK+rhzU8D0aCVvLseAQVRaXW4G92yHzxJKJra8TZ+R1Weh8Z7hALkkuaIn3pmWMyHV+evCubYNOdmKalnS6unroLdC3fHSlfc4Xf1UN9O8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592132; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1wrdwkRGYkuSk3rj6CnPi/iBOBu5z8tzIyT4LderEHI=; b=XQDemayDyzQy4zt6H8d5exmraOvjgTIr+3ikr9EB0DfsSz2e/oSSKPpkaIoGxlwjps1ZmbD31EWQfOB4RGE3cdFHWEniz1pu8p9SwwmfsqDBDv2Q+O/pDxWsTg30gYTa1YizTf8/h7wdAwMV/Ya6QF+loj+I1+djPAR5oxiieQI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592132942464.25356051354584; Tue, 15 Jul 2025 08:08:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhGB-0004pV-Gv; Tue, 15 Jul 2025 11:07:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubgi0-00048R-63 for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubghn-0006eQ-OV for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:32 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-327-752nzDGZOg-iLRQMAU411Q-1; Tue, 15 Jul 2025 10:32:25 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 802B819560AA; Tue, 15 Jul 2025 14:32:23 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8F431180045B; Tue, 15 Jul 2025 14:32:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1wrdwkRGYkuSk3rj6CnPi/iBOBu5z8tzIyT4LderEHI=; b=IH87EKL4UAUT6fhn5hBX5J5swF5e6K0PeYY2OR33t20jvNi/xz2iRawcC41jjx97vsD1mn D+vWnBdU1URyd8duktZ2JBAUeFalbCrIgJ9UtNMRix9DINpRE3S6zkG1xqJSGMWRCZiCtY a5XQhXtmZcHHb70vU4uDoUn2x35eg2g= X-MC-Unique: 752nzDGZOg-iLRQMAU411Q-1 X-Mimecast-MFC-AGG-ID: 752nzDGZOg-iLRQMAU411Q_1752589943 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 12/14] iotests/147: ensure temporary sockets are closed before exiting Date: Tue, 15 Jul 2025 15:30:21 +0100 Message-ID: <20250715143023.1851000-13-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592133675116600 This avoids the python resource leak detector from issuing warnings in the iotests. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Snow --- tests/qemu-iotests/147 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/147 b/tests/qemu-iotests/147 index 6d6f077a14..3e14bd389a 100755 --- a/tests/qemu-iotests/147 +++ b/tests/qemu-iotests/147 @@ -277,6 +277,7 @@ class BuiltinNBD(NBDBlockdevAddBase): } } self.client_test(filename, flatten_sock_addr(address), 'nbd-export= ') =20 + sockfd.close() self._server_down() =20 =20 --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592206; cv=none; d=zohomail.com; s=zohoarc; b=QdP6qb04cG8F5UNq3dNxC01rxNEcFiJt8xts3e4KJ9VWx2G0LFtO6BXUcAG37f0wK4fxVHdNPSUPvMv/NtvY8lla43DW6zKT+0bJLq7sLegyWyeuXpiu/vc64oZEiVOzH1gfAa2hEm73s6vR/3TQd6vK1MPMC0LqHpo9vqz6mUU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592206; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hf6xFpkyK4Q5hX3V/J0+LOqBe1cYkBrkakptg/l3pjQ=; b=Q9muYkB/D8gOHGxV5Lej1OkYvPpPsTbVEB79ROIbWzz1JARJQCj10Va7fb4ZjizEizdzW0HIcGMyXM+23QSS7mU5TbezQeHwH+kEWvlszi/Atp+4nu8wmYAwu2uqLE24DHzCcmxjb2YGOzZPzUGmlKe4Cp5q3aRTzH823mpuBEY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592206913556.2811716590355; Tue, 15 Jul 2025 08:10:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhGH-00057R-93; Tue, 15 Jul 2025 11:08:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubgi9-0004OE-Hq for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubgi1-0006fZ-35 for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:48 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-659-GyROHH3PMv-ZXmXVAAdUCw-1; Tue, 15 Jul 2025 10:32:33 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0ABD61800368; Tue, 15 Jul 2025 14:32:32 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E306F180045B; Tue, 15 Jul 2025 14:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hf6xFpkyK4Q5hX3V/J0+LOqBe1cYkBrkakptg/l3pjQ=; b=UvHSTkGRfgofu0QnoHVJcM3XqOc/+epn8WZ5pdHFDP+63+gjrBzjal8iRZMcAqgpp5jqbn JIMEKM+PDjHtueh5ToKqFUY3v+S3DRtOR6306rdVm0QijBMGsBFzunljwqjJ+dX2vCmGJ4 IL5W+SxWc5nKj3g87pletoAQio4vazM= X-MC-Unique: GyROHH3PMv-ZXmXVAAdUCw-1 X-Mimecast-MFC-AGG-ID: GyROHH3PMv-ZXmXVAAdUCw_1752589952 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 13/14] iotests/151: ensure subprocesses are cleaned up Date: Tue, 15 Jul 2025 15:30:22 +0100 Message-ID: <20250715143023.1851000-14-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, T_SPF_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592208970116600 The iotest 151 creates a bunch of subprocesses, with their stdout connected to a pipe but never reads any data from them and does not gurantee the processes are killed on cleanup. This triggers resource leak warnings from python when the subprocess.Popen object is garbage collected. Signed-off-by: Daniel P. Berrang=C3=A9 --- tests/qemu-iotests/151 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/qemu-iotests/151 b/tests/qemu-iotests/151 index f2ff9c5dac..06ee3585db 100755 --- a/tests/qemu-iotests/151 +++ b/tests/qemu-iotests/151 @@ -263,6 +263,11 @@ class TestThrottledWithNbdExportBase(iotests.QMPTestCa= se): break except subprocess.TimeoutExpired: self.vm.qtest(f'clock_step {1 * 1000 * 1000 * 1000= }') + try: + p.kill() + p.stdout.close() + except: + pass except IndexError: pass =20 --=20 2.49.0 From nobody Sat Nov 15 10:52:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1752592186; cv=none; d=zohomail.com; s=zohoarc; b=JIOIfCggBHYC5qF9j+7+/VK24348pXYTluhnnUla486DHNGILoNDlpNLL2cTo5is3yC18On7H6WoPGhlVxS9Of4CBwetaRsTFkwHlAujRTuJxGFCHG6FpECXWrkUD9v6Xg7l+sgCEgr0B/PzUMhKA0mHi8uuPznda/hhjf6DY0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752592186; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bQtMaQNoD7pJpZxe1Rk+WCVM9f4dDgR9Bfdu58KAe/Y=; b=VNbV4y5JirPJyuKPsaDj91H5pFW1mCAVA/DGsQ0Ih2mlC8RNkLBXtz4X7BjhRQALQ5oQ/+mcV4L3gHqmkQjm6oVYrHjoktXMoe+c9pNh698vtArsR4XemJtA1sS3PhUT080G//PL24ODMFvJPESt12XtFiF6ygi97+5WOAmrRco= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1752592186244223.85093397631886; Tue, 15 Jul 2025 08:09:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ubhHd-0007DF-Sn; Tue, 15 Jul 2025 11:09:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubgiD-0004ZL-Tb for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ubgi7-0006gg-LA for qemu-devel@nongnu.org; Tue, 15 Jul 2025 10:32:53 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-164-itAqtj_AOKqpnoN6BnSoWQ-1; Tue, 15 Jul 2025 10:32:42 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E890E18002A7; Tue, 15 Jul 2025 14:32:40 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.173]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6985D18002B1; Tue, 15 Jul 2025 14:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752589965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bQtMaQNoD7pJpZxe1Rk+WCVM9f4dDgR9Bfdu58KAe/Y=; b=hbDanhwl2s+gSSCu9ti1bQXQhGA6u7Pd35a/7uCy5zck12cGYzEfyHjwUFr6RHrIvVPYky wlGFskclXBrufylUEaCEFIjZPSc+JtDrapWv38aJb5Z5TZQ8DKT2QPviq0fab1Ohzr/ZNG a4Xh60Yfk+YBLgcx8HzRIboXuf7fgnU= X-MC-Unique: itAqtj_AOKqpnoN6BnSoWQ-1 X-Mimecast-MFC-AGG-ID: itAqtj_AOKqpnoN6BnSoWQ_1752589961 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Hanna Reitz , Jagannathan Raman , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Elena Ufimtseva , Thomas Huth , Cleber Rosa , qemu-block@nongnu.org, John Snow , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 14/14] iotests/check: always enable all python warnings Date: Tue, 15 Jul 2025 15:30:23 +0100 Message-ID: <20250715143023.1851000-15-berrange@redhat.com> In-Reply-To: <20250715143023.1851000-1-berrange@redhat.com> References: <20250715143023.1851000-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1752592188541116600 Of most importance is that this gives us a heads-up if anything we rely on has been deprecated. The default python behaviour only emits a warning if triggered from __main__ which is very limited. Setting the env variable further ensures that any python child processes will also display warnings. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Snow --- tests/qemu-iotests/check | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 545f9ec7bd..d9b7c1d598 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -21,6 +21,7 @@ import sys import argparse import shutil from pathlib import Path +import warnings =20 from findtests import TestFinder from testenv import TestEnv @@ -137,6 +138,9 @@ def make_argparser() -> argparse.ArgumentParser: =20 =20 if __name__ =3D=3D '__main__': + warnings.simplefilter("default") + os.environ["PYTHONWARNINGS"] =3D "default" + args =3D make_argparser().parse_args() =20 env =3D TestEnv(source_dir=3Dargs.source_dir, --=20 2.49.0