From nobody Sun May 19 10:14:48 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696448894; cv=none; d=zohomail.com; s=zohoarc; b=la6e3272Ng4ZooUbj6U5pmqArCRflINjUePZcf6vhXsmx2slkqZmzxoBuPf6T5PH0fpOUW+PYu6lGGfOIMc25FaibUZkLPzD4jHYaeVpJrHchOvOdlCiVtDN3ZkoDOinBJK45ZVmDfLmKjnvY0mvsK+JuTqM90WKE6fr6OGFnkc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696448894; h=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=E9MWhcZdOckvKdPPyQRZQPaqlNKCSIWZTSIJBtiOjhQ=; b=P/wN0ovbPCw/k+xfIYcootmKfkHpXEu7W7zTLgJ7aJI0qZaSUKeRXNcf2lA3Ieql3sEDu3hUrwyGq0RdBLbwpToZU5MpWmHxkmcdY1DLNbJBbeBkxkGcbvXIxZrzEH1fUWuIEhNA2ShO22NudF5Cb7w/x84v20tuolN9KGiVCAc= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696448894914203.7679917990098; Wed, 4 Oct 2023 12:48:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo7pO-0004qK-EI; Wed, 04 Oct 2023 15:46:38 -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 1qo7pN-0004pW-7p for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:37 -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 1qo7pK-0005Dh-6K for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:36 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-443-zk3WSzupN8mkdp0C85VPSg-1; Wed, 04 Oct 2023 15:46:17 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 954AA8007A4; Wed, 4 Oct 2023 19:46:16 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.16.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91D111006B48; Wed, 4 Oct 2023 19:46:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696448793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E9MWhcZdOckvKdPPyQRZQPaqlNKCSIWZTSIJBtiOjhQ=; b=WvwKb4rNfqq8tRhRLSANhpzYw0S+OPD9Ii2EYcmP0nX0uoo8I05/8iI/+wEciXk4+G4T8C xwJe1uc8tbrIOrVdJqnqDCyRA6u1zgrC+nDeulavVlSHAb9DMfYMMtHfrTQAEH3CE/Bcfg wEIqIHqgc6XCAlro17MmeK3VJMSR0cs= X-MC-Unique: zk3WSzupN8mkdp0C85VPSg-1 From: John Snow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Wainer dos Santos Moschetta , Kevin Wolf , Andrew Jeffery , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa , Peter Maydell , qemu-arm@nongnu.org, Joel Stanley , qemu-block@nongnu.org, Beraldo Leal , Vladimir Sementsov-Ogievskiy , Hanna Reitz , "Michael S. Tsirkin" , Vladimir Sementsov-Ogievskiy , Thomas Huth , Eric Blake , Ani Sinha , Eduardo Habkost , Markus Armbruster Subject: [PULL 1/9] Python/iotests: Add type hint for nbd module Date: Wed, 4 Oct 2023 15:46:05 -0400 Message-ID: <20231004194613.2900323-2-jsnow@redhat.com> In-Reply-To: <20231004194613.2900323-1-jsnow@redhat.com> References: <20231004194613.2900323-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=jsnow@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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: 1696448896239100001 Content-Type: text/plain; charset="utf-8" The test bails gracefully if this module isn't installed, but linters need a little help understanding that. It's enough to just declare the type in this case. (Fixes pylint complaining about use of an uninitialized variable because it isn't wise enough to understand the notrun call is noreturn.) Signed-off-by: John Snow Reviewed-by: Eric Blake --- tests/qemu-iotests/tests/nbd-multiconn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/tests/nbd-multiconn b/tests/qemu-iotests/te= sts/nbd-multiconn index 478a1eaba27..7e686a786ea 100755 --- a/tests/qemu-iotests/tests/nbd-multiconn +++ b/tests/qemu-iotests/tests/nbd-multiconn @@ -20,6 +20,8 @@ =20 import os from contextlib import contextmanager +from types import ModuleType + import iotests from iotests import qemu_img_create, qemu_io =20 @@ -28,7 +30,7 @@ disk =3D os.path.join(iotests.test_dir, 'disk') size =3D '4M' nbd_sock =3D os.path.join(iotests.sock_dir, 'nbd_sock') nbd_uri =3D 'nbd+unix:///{}?socket=3D' + nbd_sock - +nbd: ModuleType =20 @contextmanager def open_nbd(export_name): --=20 2.41.0 From nobody Sun May 19 10:14:48 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696448897; cv=none; d=zohomail.com; s=zohoarc; b=C+XS0ISel1++LiROvJnDECsGw5KGjjdPGDUID6KjcuNqZ69vwYDONQAxmObd4sZwS5753LGC0f7LxcQrwuTHHe1TBag98tGDm8HnAF9AaRuh+pdNbwOzxO2TRruoXqjbpZUOPjebdJWvhi4EoYU55fug9/F95OWvFhrM/2WpD1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696448897; 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=q9h+cageP+sFv7Pz8M2/uena7/9BQ+/VSci8+mUVQIo=; b=Pj9RiUy05tHBrdy8rioFiLUFWe9xxCXhi2MKpR8Igj2dH3J67FxVrBiseTVp6psDy4sR6YUA62EytyjkCT4xZiThZPHFPchsbO5Vv+ubpVSEONR639lPsCX52kw21tIl7A/6nRBkQKN3FL8TFKU4nMd+ulIJOUVBvLtrisgtpds= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696448897946814.02768194541; Wed, 4 Oct 2023 12:48:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo7pD-0004hU-Ri; Wed, 04 Oct 2023 15:46:28 -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 1qo7pB-0004g2-Fb for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:25 -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 1qo7p9-00058R-Uc for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:25 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-94-3DTRmH4zM9mG88Pv9be21g-1; Wed, 04 Oct 2023 15:46:18 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B0048185A79B; Wed, 4 Oct 2023 19:46:17 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.16.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id A87731005B8E; Wed, 4 Oct 2023 19:46:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696448782; 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=q9h+cageP+sFv7Pz8M2/uena7/9BQ+/VSci8+mUVQIo=; b=ak58GLhnnSS/YRmbr6L2mdm9JedNFZV96L3YnyTManV3NBGQSbnbgW+bYQYeN9XT819kob ATGLPpMUNWJKBtxwZIQmW1lTxWk91rKrgW7a3ec3/9Ydq/KBQladhBOtVuKz3E8ufqUQ30 uaPga46Uhp9DBN6wyFeoLF/7qqJPB/Y= X-MC-Unique: 3DTRmH4zM9mG88Pv9be21g-1 From: John Snow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Wainer dos Santos Moschetta , Kevin Wolf , Andrew Jeffery , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa , Peter Maydell , qemu-arm@nongnu.org, Joel Stanley , qemu-block@nongnu.org, Beraldo Leal , Vladimir Sementsov-Ogievskiy , Hanna Reitz , "Michael S. Tsirkin" , Vladimir Sementsov-Ogievskiy , Thomas Huth , Eric Blake , Ani Sinha , Eduardo Habkost , Markus Armbruster , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 2/9] python/machine: move socket setup out of _base_args property Date: Wed, 4 Oct 2023 15:46:06 -0400 Message-ID: <20231004194613.2900323-3-jsnow@redhat.com> In-Reply-To: <20231004194613.2900323-1-jsnow@redhat.com> References: <20231004194613.2900323-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=jsnow@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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: 1696448898272100005 This property isn't meant to do much else besides return a list of strings, so move this setup back out into _pre_launch(). Signed-off-by: John Snow Reviewed-by: Ani Sinha Reviewed-by: Daniel P. Berrang=C3=A9 Message-id: 20230928044943.849073-2-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/machine/machine.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 35d5a672dbb..345610d6e46 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -301,9 +301,7 @@ def _base_args(self) -> List[str]: =20 if self._qmp_set: if self._sock_pair: - fd =3D self._sock_pair[0].fileno() - os.set_inheritable(fd, True) - moncdev =3D f"socket,id=3Dmon,fd=3D{fd}" + moncdev =3D f"socket,id=3Dmon,fd=3D{self._sock_pair[0].fil= eno()}" elif isinstance(self._monitor_address, tuple): moncdev =3D "socket,id=3Dmon,host=3D{},port=3D{}".format( *self._monitor_address @@ -340,6 +338,7 @@ def _pre_launch(self) -> None: if self._qmp_set: if self._monitor_address is None: self._sock_pair =3D socket.socketpair() + os.set_inheritable(self._sock_pair[0].fileno(), True) sock =3D self._sock_pair[1] if isinstance(self._monitor_address, str): self._remove_files.append(self._monitor_address) --=20 2.41.0 From nobody Sun May 19 10:14:48 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696448876; cv=none; d=zohomail.com; s=zohoarc; b=kSTT9Een3Fb80hL4KIUO/9/p6B+m7lGElUOOdMY0YybusVf9nvp6VehZ7dqGMiehG1L7PVPvo8ankmtrFpRYcZ5mkTqYgAqH9dc0iE1J1RqPUcIiiE+F9AwkztAQo75euazRktGuVeX0FKZBtfmcgZFfWAb9Ny/hXFem6ILpQ8s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696448876; 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=raq/k8U+cncgPegZd3oiql+A86isPBHe+RMtq6Gv31U=; b=RsBwxHnw2jIPoyhAp1os6/SV5iOXV4XQp04hofp2JcgTaGeELfEVW3FJBWOtkk6XwJfrhfl6NNkKhCmtvkGNxMZew6mguufjzSLg6VeCjt3W04RGHOnfIVZytloRdWwuEYvjBDSOSzaPiaejiMyWvUeg56rx/Q1vfsyQ9ASrlMc= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169644887605880.58431685069672; Wed, 4 Oct 2023 12:47:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo7pH-0004kr-G5; Wed, 04 Oct 2023 15:46:31 -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 1qo7pF-0004jE-AO for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46: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 1qo7pB-000598-FN for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:29 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-453-q-PJiirLMJ-5tivhjCvg0Q-1; Wed, 04 Oct 2023 15:46:19 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B52FB85A5BA; Wed, 4 Oct 2023 19:46:18 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.16.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id BCFC31054FC1; Wed, 4 Oct 2023 19:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696448783; 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=raq/k8U+cncgPegZd3oiql+A86isPBHe+RMtq6Gv31U=; b=cwLLVnHFjMIIwRiV6fjndtR8D7VJpWz8lSoEZjoJQ+zR9bLp1jStB4PS5bdVCXfxykytTE EX0idNz5fta2HgXnokVFfBYgCWYO3eHyX3jOhqNv28Q4tEj+cakE4uIDWvVFCrCdRtwH3u W4kof15UZuLK0uxPKze+StK+TD2pK7M= X-MC-Unique: q-PJiirLMJ-5tivhjCvg0Q-1 From: John Snow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Wainer dos Santos Moschetta , Kevin Wolf , Andrew Jeffery , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa , Peter Maydell , qemu-arm@nongnu.org, Joel Stanley , qemu-block@nongnu.org, Beraldo Leal , Vladimir Sementsov-Ogievskiy , Hanna Reitz , "Michael S. Tsirkin" , Vladimir Sementsov-Ogievskiy , Thomas Huth , Eric Blake , Ani Sinha , Eduardo Habkost , Markus Armbruster , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 3/9] python/machine: close sock_pair in cleanup path Date: Wed, 4 Oct 2023 15:46:07 -0400 Message-ID: <20231004194613.2900323-4-jsnow@redhat.com> In-Reply-To: <20231004194613.2900323-1-jsnow@redhat.com> References: <20231004194613.2900323-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=jsnow@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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: 1696448878277100003 If everything has gone smoothly, we'll already have closed the socket we gave to the child during post_launch. The other half of the pair that we gave to the QMP connection should, likewise, be definitively closed by now. However, in the cleanup path, it's possible we've created the socketpair but flubbed the launch and need to clean up resources. These resources *would* be handled by the garbage collector, but that can happen at unpredictable times. Nicer to just clean them up synchronously on the exit path, here. Signed-off-by: John Snow Reviewed-by: Ani Sinha Reviewed-by: Daniel P. Berrang=C3=A9 Message-id: 20230928044943.849073-3-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/machine/machine.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 345610d6e46..e26109e6f0e 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -396,6 +396,11 @@ def _post_shutdown(self) -> None: finally: assert self._qmp_connection is None =20 + if self._sock_pair: + self._sock_pair[0].close() + self._sock_pair[1].close() + self._sock_pair =3D None + self._close_qemu_log_file() =20 self._load_io_log() --=20 2.41.0 From nobody Sun May 19 10:14:48 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696448864; cv=none; d=zohomail.com; s=zohoarc; b=oDzChiA8gYzEza1foy+qZQLwOfN+76CmRpGSOaS+35ne5bWUDP47y3T+XasH5z5weyG7FAuNroI9keiCzckFwQgF+og5pEDkt0eHZViyqvP56DcQER+N3Z/JSF3Gv0T0VPQAnWip7JpoJINWRFJ9Vk2JgvlX4SiT07TxdSYQLxM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696448864; 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=jTZZv+B4GQU8V204gzdoSm/m/cM8SbdIuVk0hYYZBR8=; b=CjynhWfrGXZ/aSPpjbDm1I2a6NR2wz2QJ7AHPgAlaJgo06Bo1Qp66/Ms0/YLvk88LWFPdPWiGLQxqS0DgSHn1/tnO9E00Rfok7P2u5Phgt8QA0+agfCHUMB1MgSJ1aQ85yMd1+tQJZEai4VG4nzCRh0QuCFfvzyjZfXha0xpalg= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696448864898415.26561575820017; Wed, 4 Oct 2023 12:47:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo7pF-0004iz-54; Wed, 04 Oct 2023 15:46:29 -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 1qo7pE-0004ht-3I for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:28 -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 1qo7pA-00058v-JU for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:27 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-224-r49WVZUMPKebRhYbeWxxqA-1; Wed, 04 Oct 2023 15:46:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A20F881D786; Wed, 4 Oct 2023 19:46:19 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.16.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id C152F1054FC1; Wed, 4 Oct 2023 19:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696448784; 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=jTZZv+B4GQU8V204gzdoSm/m/cM8SbdIuVk0hYYZBR8=; b=Qc7sd/R5vBTVr+gTNkJ4SdHZEQazR8TW//8WHET8kWfx+jnWmO6dIjXAmocxQTe4A/GEtP x51zKTsPTlQES+p70yY6zZNKf805E4UlxuFPM/9vskAjBS+biXVniC4VxpPlauonGuImyS d/tkN8rFVVJw0Qe6HLBiyHkw8HRqLSQ= X-MC-Unique: r49WVZUMPKebRhYbeWxxqA-1 From: John Snow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Wainer dos Santos Moschetta , Kevin Wolf , Andrew Jeffery , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa , Peter Maydell , qemu-arm@nongnu.org, Joel Stanley , qemu-block@nongnu.org, Beraldo Leal , Vladimir Sementsov-Ogievskiy , Hanna Reitz , "Michael S. Tsirkin" , Vladimir Sementsov-Ogievskiy , Thomas Huth , Eric Blake , Ani Sinha , Eduardo Habkost , Markus Armbruster , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 4/9] python/console_socket: accept existing FD in initializer Date: Wed, 4 Oct 2023 15:46:08 -0400 Message-ID: <20231004194613.2900323-5-jsnow@redhat.com> In-Reply-To: <20231004194613.2900323-1-jsnow@redhat.com> References: <20231004194613.2900323-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=jsnow@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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: 1696448866378100003 Useful if we want to use ConsoleSocket() for a socket created by socketpair(). Signed-off-by: John Snow Reviewed-by: Ani Sinha Reviewed-by: Daniel P. Berrang=C3=A9 Message-id: 20230928044943.849073-4-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/machine/console_socket.py | 29 +++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/python/qemu/machine/console_socket.py b/python/qemu/machine/co= nsole_socket.py index 4e28ba9bb23..0a4e09ffc73 100644 --- a/python/qemu/machine/console_socket.py +++ b/python/qemu/machine/console_socket.py @@ -24,19 +24,32 @@ class ConsoleSocket(socket.socket): """ ConsoleSocket represents a socket attached to a char device. =20 - Optionally (if drain=3D=3DTrue), drains the socket and places the bytes - into an in memory buffer for later processing. - - Optionally a file path can be passed in and we will also - dump the characters to this file for debugging purposes. + :param address: An AF_UNIX path or address. + :param sock_fd: Optionally, an existing socket file descriptor. + One of address or sock_fd must be specified. + :param file: Optionally, a filename to log to. + :param drain: Optionally, drains the socket and places the bytes + into an in memory buffer for later processing. """ - def __init__(self, address: str, file: Optional[str] =3D None, + def __init__(self, + address: Optional[str] =3D None, + sock_fd: Optional[int] =3D None, + file: Optional[str] =3D None, drain: bool =3D False): + if address is None and sock_fd is None: + raise ValueError("one of 'address' or 'sock_fd' must be specif= ied") + if address is not None and sock_fd is not None: + raise ValueError("can't specify both 'address' and 'sock_fd'") + self._recv_timeout_sec =3D 300.0 self._sleep_time =3D 0.5 self._buffer: Deque[int] =3D deque() - socket.socket.__init__(self, socket.AF_UNIX, socket.SOCK_STREAM) - self.connect(address) + if address is not None: + socket.socket.__init__(self, socket.AF_UNIX, socket.SOCK_STREA= M) + self.connect(address) + else: + assert sock_fd is not None + socket.socket.__init__(self, fileno=3Dsock_fd) self._logfile =3D None if file: # pylint: disable=3Dconsider-using-with --=20 2.41.0 From nobody Sun May 19 10:14:48 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696448937; cv=none; d=zohomail.com; s=zohoarc; b=ljLIIU8qiNi5gsizEUAq2Hn3Y+wIqe0HVfL55j55X8IHGWVXiCVE6l081FQB3fyDzp0wvE/JlP6skmvjFv0aROZhDZsTK3eET4p53V5FzBRgUOBrGZxlARIfJrRDK36H7qRl55r1CkOQdwIicNax7Cep5Bwd4HMVYJ9FXDTh3yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696448937; 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=mVjnzkFb6jqe186MzH7ifkiBtaZPoadf/dEtoPMNUEY=; b=QlMkzfApRWDuuxKYCx77pPzcwl0qPYuL6tF7Vr7AUCKnZNGcXXX974M+n7w/x/xGvUXtuXvmtdvAHczPtXHcYrjz1EPqDPVx9CTMjMeHVOzD6uVy0Gj5I5oDRwIz8DbV3qOBI4CX2AicejMyBufP2gVbb9my3xfBa9bbxNhNdeE= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16964489376981004.0548308671977; Wed, 4 Oct 2023 12:48:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo7pV-0004uA-0j; Wed, 04 Oct 2023 15:46:45 -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 1qo7pT-0004rT-5v for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:43 -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 1qo7pD-0005AF-Hh for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:42 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-510--1mErR4kPPGo29Qvissxxg-1; Wed, 04 Oct 2023 15:46:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9AC713C0E660; Wed, 4 Oct 2023 19:46:20 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.16.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id B73E21054FC2; Wed, 4 Oct 2023 19:46:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696448787; 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=mVjnzkFb6jqe186MzH7ifkiBtaZPoadf/dEtoPMNUEY=; b=QC82YGhWqrRxsEVWIXtij1VSVBDKSK+4sl9/AbZcSmqkmX1zVyd8KOKqcALrO60UsyW8yS 1jqDkduusLM6+Mld2aI9QwAO+p5GF0jMwmf3JfmN7WrXAhSJNvYQTFy2ts6vDyM+gUEdA0 CDZcQkeVkVQwur9iuv+fcijMGdHr5uk= X-MC-Unique: -1mErR4kPPGo29Qvissxxg-1 From: John Snow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Wainer dos Santos Moschetta , Kevin Wolf , Andrew Jeffery , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa , Peter Maydell , qemu-arm@nongnu.org, Joel Stanley , qemu-block@nongnu.org, Beraldo Leal , Vladimir Sementsov-Ogievskiy , Hanna Reitz , "Michael S. Tsirkin" , Vladimir Sementsov-Ogievskiy , Thomas Huth , Eric Blake , Ani Sinha , Eduardo Habkost , Markus Armbruster , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 5/9] python/machine: use socketpair() for console connections Date: Wed, 4 Oct 2023 15:46:09 -0400 Message-ID: <20231004194613.2900323-6-jsnow@redhat.com> In-Reply-To: <20231004194613.2900323-1-jsnow@redhat.com> References: <20231004194613.2900323-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=jsnow@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, SPF_HELO_NONE=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: 1696448939150100003 Create a socketpair for the console output. This should help eliminate race conditions around console text early in the boot process that might otherwise have been dropped on the floor before being able to connect to QEMU under "server,nowait". Signed-off-by: John Snow Reviewed-by: Ani Sinha Reviewed-by: Daniel P. Berrang=C3=A9 Message-id: 20230928044943.849073-5-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/machine/machine.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index e26109e6f0e..4156b8cf7d4 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -159,6 +159,8 @@ def __init__(self, =20 self._name =3D name or f"{id(self):x}" self._sock_pair: Optional[Tuple[socket.socket, socket.socket]] =3D= None + self._cons_sock_pair: Optional[ + Tuple[socket.socket, socket.socket]] =3D None self._temp_dir: Optional[str] =3D None self._base_temp_dir =3D base_temp_dir self._sock_dir =3D sock_dir @@ -316,8 +318,9 @@ def _base_args(self) -> List[str]: for _ in range(self._console_index): args.extend(['-serial', 'null']) if self._console_set: - chardev =3D ('socket,id=3Dconsole,path=3D%s,server=3Don,wait= =3Doff' % - self._console_address) + assert self._cons_sock_pair is not None + fd =3D self._cons_sock_pair[0].fileno() + chardev =3D f"socket,id=3Dconsole,fd=3D{fd}" args.extend(['-chardev', chardev]) if self._console_device_type is None: args.extend(['-serial', 'chardev:console']) @@ -352,6 +355,10 @@ def _pre_launch(self) -> None: nickname=3Dself._name ) =20 + if self._console_set: + self._cons_sock_pair =3D socket.socketpair() + os.set_inheritable(self._cons_sock_pair[0].fileno(), True) + # NOTE: Make sure any opened resources are *definitely* freed in # _post_shutdown()! # pylint: disable=3Dconsider-using-with @@ -369,6 +376,9 @@ def _pre_launch(self) -> None: def _post_launch(self) -> None: if self._sock_pair: self._sock_pair[0].close() + if self._cons_sock_pair: + self._cons_sock_pair[0].close() + if self._qmp_connection: if self._sock_pair: self._qmp.connect() @@ -524,6 +534,11 @@ def _early_cleanup(self) -> None: self._console_socket.close() self._console_socket =3D None =20 + if self._cons_sock_pair: + self._cons_sock_pair[0].close() + self._cons_sock_pair[1].close() + self._cons_sock_pair =3D None + def _hard_shutdown(self) -> None: """ Perform early cleanup, kill the VM, and wait for it to terminate. @@ -885,10 +900,19 @@ def console_socket(self) -> socket.socket: """ if self._console_socket is None: LOG.debug("Opening console socket") + if not self._console_set: + raise QEMUMachineError( + "Attempt to access console socket with no connection") + assert self._cons_sock_pair is not None + # os.dup() is used here for sock_fd because otherwise we'd + # have two rich python socket objects that would each try to + # close the same underlying fd when either one gets garbage + # collected. self._console_socket =3D console_socket.ConsoleSocket( - self._console_address, + sock_fd=3Dos.dup(self._cons_sock_pair[1].fileno()), file=3Dself._console_log_path, drain=3Dself._drain_console) + self._cons_sock_pair[1].close() return self._console_socket =20 @property --=20 2.41.0 From nobody Sun May 19 10:14:48 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696448864; cv=none; d=zohomail.com; s=zohoarc; b=IHppKZcvQPZ2CHYdqZxYvvbMU2BJmUXr2YPiIsKOQ6awi18hngge4uzBnIFovvOlJ+jFbdYyk1P+1/qjhBjc4jththiYhhkGpBXu6G/C4Y88+GDtFTG0JYiTYYObNnAVpyo3XzI8erjn3JwKh3ryHKR22gDs27bT7oTpe3SHeEE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696448864; 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=EKJk7XVB2DViVMMKfF/Lt/CVsitRtP9avGJrQHTVjGQ=; b=GhLt+0h0nN+ZKgR46hibdNa3ouZVX/++1zJs14fk5DmKuH0tteS8Z9LbPGxninakx1k9Bg68gVXKvshQ7Hz3/vbuz8JTZXWA/J1ANO8k7kX1CLtULphAZp1/89zNk30+zcgh6NiSRbQ9vpn3MlzTc/rWH/1y/oRn7StXDMYWJ28= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696448864070565.9485619071033; Wed, 4 Oct 2023 12:47:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo7pQ-0004r6-V0; Wed, 04 Oct 2023 15:46:40 -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 1qo7pP-0004qo-DB for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:39 -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 1qo7pC-00059g-4q for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:39 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-246-_yoS9iTfP7-Z29OlqBEk6A-1; Wed, 04 Oct 2023 15:46:22 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D5F12825E9A; Wed, 4 Oct 2023 19:46:21 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.16.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD4471054FC2; Wed, 4 Oct 2023 19:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696448785; 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=EKJk7XVB2DViVMMKfF/Lt/CVsitRtP9avGJrQHTVjGQ=; b=CiTiROXTmhefPyXwTJcF+Z1Wu8w91UXCHH2ap0P+Khyu7K3MqoRcn4bRyCiU/qizi5fUJX XSg8u0nxPGwXpIMzqE52xZHBDp4Q31WvXJdd8G48emR2HPDPeO+9nlzc1e09OqMuyFgE8I 4j7e2BgDAhxq55r8Xtm/ms+lRcAV/8k= X-MC-Unique: _yoS9iTfP7-Z29OlqBEk6A-1 From: John Snow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Wainer dos Santos Moschetta , Kevin Wolf , Andrew Jeffery , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa , Peter Maydell , qemu-arm@nongnu.org, Joel Stanley , qemu-block@nongnu.org, Beraldo Leal , Vladimir Sementsov-Ogievskiy , Hanna Reitz , "Michael S. Tsirkin" , Vladimir Sementsov-Ogievskiy , Thomas Huth , Eric Blake , Ani Sinha , Eduardo Habkost , Markus Armbruster , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 6/9] python/machine: use socketpair() for qtest connection Date: Wed, 4 Oct 2023 15:46:10 -0400 Message-ID: <20231004194613.2900323-7-jsnow@redhat.com> In-Reply-To: <20231004194613.2900323-1-jsnow@redhat.com> References: <20231004194613.2900323-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=jsnow@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, SPF_HELO_NONE=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: 1696448866402100004 Like the QMP and console sockets, begin using socketpairs for the qtest connection, too. After this patch, we'll be able to remove the vestigial sock_dir argument, but that cleanup is best done in its own patch. Signed-off-by: John Snow Reviewed-by: Daniel P. Berrang=C3=A9 Message-id: 20230928044943.849073-6-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/machine/qtest.py | 49 +++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py index 1c46138bd0c..8180d3ab017 100644 --- a/python/qemu/machine/qtest.py +++ b/python/qemu/machine/qtest.py @@ -24,6 +24,7 @@ Optional, Sequence, TextIO, + Tuple, ) =20 from qemu.qmp import SocketAddrT @@ -38,23 +39,41 @@ class QEMUQtestProtocol: :param address: QEMU address, can be either a unix socket path (string) or a tuple in the form ( address, port ) for a TCP connection - :param server: server mode, listens on the socket (bool) + :param sock: An existing socket can be provided as an alternative to + an address. One of address or sock must be provided. + :param server: server mode, listens on the socket. Only meaningful + in conjunction with an address and not an existing + socket. + :raise socket.error: on socket connection errors =20 .. note:: No connection is established by __init__(), this is done by the connect() or accept() methods. """ - def __init__(self, address: SocketAddrT, + def __init__(self, + address: Optional[SocketAddrT] =3D None, + sock: Optional[socket.socket] =3D None, server: bool =3D False): + if address is None and sock is None: + raise ValueError("Either 'address' or 'sock' must be specified= ") + if address is not None and sock is not None: + raise ValueError( + "Either 'address' or 'sock' must be specified, but not bot= h") + if sock is not None and server: + raise ValueError("server=3DTrue is meaningless when passing so= cket") + self._address =3D address - self._sock =3D self._get_sock() + self._sock =3D sock or self._get_sock() self._sockfile: Optional[TextIO] =3D None + if server: + assert self._address is not None self._sock.bind(self._address) self._sock.listen(1) =20 def _get_sock(self) -> socket.socket: + assert self._address is not None if isinstance(self._address, tuple): family =3D socket.AF_INET else: @@ -67,7 +86,8 @@ def connect(self) -> None: =20 @raise socket.error on socket connection errors """ - self._sock.connect(self._address) + if self._address is not None: + self._sock.connect(self._address) self._sockfile =3D self._sock.makefile(mode=3D'r') =20 def accept(self) -> None: @@ -127,29 +147,40 @@ def __init__(self, base_temp_dir=3Dbase_temp_dir, sock_dir=3Dsock_dir, qmp_timer=3Dqmp_timer) self._qtest: Optional[QEMUQtestProtocol] =3D None - self._qtest_path =3D os.path.join(sock_dir, name + "-qtest.sock") + self._qtest_sock_pair: Optional[ + Tuple[socket.socket, socket.socket]] =3D None =20 @property def _base_args(self) -> List[str]: args =3D super()._base_args + assert self._qtest_sock_pair is not None + fd =3D self._qtest_sock_pair[0].fileno() args.extend([ - '-qtest', f"unix:path=3D{self._qtest_path}", + '-chardev', f"socket,id=3Dqtest,fd=3D{fd}", + '-qtest', 'chardev:qtest', '-accel', 'qtest' ]) return args =20 def _pre_launch(self) -> None: + self._qtest_sock_pair =3D socket.socketpair() + os.set_inheritable(self._qtest_sock_pair[0].fileno(), True) super()._pre_launch() - self._qtest =3D QEMUQtestProtocol(self._qtest_path, server=3DTrue) + self._qtest =3D QEMUQtestProtocol(sock=3Dself._qtest_sock_pair[1]) =20 def _post_launch(self) -> None: assert self._qtest is not None super()._post_launch() - self._qtest.accept() + if self._qtest_sock_pair: + self._qtest_sock_pair[0].close() + self._qtest.connect() =20 def _post_shutdown(self) -> None: + if self._qtest_sock_pair: + self._qtest_sock_pair[0].close() + self._qtest_sock_pair[1].close() + self._qtest_sock_pair =3D None super()._post_shutdown() - self._remove_if_exists(self._qtest_path) =20 def qtest(self, cmd: str) -> str: """ --=20 2.41.0 From nobody Sun May 19 10:14:48 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696448864; cv=none; d=zohomail.com; s=zohoarc; b=OWRddbjy5m1JIM1bGy9e3aYQhnt5tLaXrBqbpUWnDQd5nIkjeLEeTZ+dYYfKXXMxScPAC53HpDOANy49ylzJ4CpbuQNYxGZJRyQ/OltWC35PkiXyFB7+nyGYCBBNRolmMBWL8+f0sl3s79QVq0/0bFAB4n+kT2l/p8E8BY8XaxY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696448864; 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=s8e0IXKXqZe6dWMOzvCuZI4rlrIkusOYaAYt4sScH5o=; b=g3i8pChHc1zHW7ZXm3iOJsBFvK6ShC1AIqfJliVwtbuXcTQb0cpdFz5flcAyrdOCNSyHlhwG8SUbOAhmbzPVaw8lsngQID0g/10QI50RtSaAsOpc2QTZLA3V3yBaSFwBw5gTWHHjkXXmgtPbdiUuHZI38YaC7LmLJaBJ4Fq+At4= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696448864644590.9593217909443; Wed, 4 Oct 2023 12:47:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo7pJ-0004mk-GJ; Wed, 04 Oct 2023 15:46:33 -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 1qo7pH-0004lQ-VQ for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:32 -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 1qo7pE-0005Ae-7y for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:31 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-695-tYOzpbkuOsCnfyG7KjvOhQ-1; Wed, 04 Oct 2023 15:46:23 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E97280349A; Wed, 4 Oct 2023 19:46:22 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.16.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id A14C41054FC1; Wed, 4 Oct 2023 19:46:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696448787; 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=s8e0IXKXqZe6dWMOzvCuZI4rlrIkusOYaAYt4sScH5o=; b=gs7zCQQvZnU2tfQWfY5fynfo3nzcJUDcJnACYEgcMTBXVA+dWxrc9Dl2lZjTbA9uu7J14J Vhcvke3YkzDQZvIx9OyNQZA/y5+WjkAGHyKpepfazYBMtY/3sr3ipJvAxwZsvYPQtSAvHS dZ+F4VV3YGxe1aCv1MkyfZ7V9QG1bqk= X-MC-Unique: tYOzpbkuOsCnfyG7KjvOhQ-1 From: John Snow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Wainer dos Santos Moschetta , Kevin Wolf , Andrew Jeffery , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa , Peter Maydell , qemu-arm@nongnu.org, Joel Stanley , qemu-block@nongnu.org, Beraldo Leal , Vladimir Sementsov-Ogievskiy , Hanna Reitz , "Michael S. Tsirkin" , Vladimir Sementsov-Ogievskiy , Thomas Huth , Eric Blake , Ani Sinha , Eduardo Habkost , Markus Armbruster , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= Subject: [PULL 7/9] python/machine: remove unused sock_dir argument Date: Wed, 4 Oct 2023 15:46:11 -0400 Message-ID: <20231004194613.2900323-8-jsnow@redhat.com> In-Reply-To: <20231004194613.2900323-1-jsnow@redhat.com> References: <20231004194613.2900323-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=jsnow@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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: 1696448866415100005 By using a socketpair for all of the sockets managed by the VM class and its extensions, we don't need the sock_dir argument anymore, so remove it. We only added this argument so that we could specify a second, shorter temporary directory for cases where the temp/log dirs were "too long" as a socket name on macOS. We don't need it for this class now. In one case, avocado testing takes over responsibility for creating an appropriate sockdir. Signed-off-by: John Snow Reviewed-by: Daniel P. Berrang=C3=A9 Message-id: 20230928044943.849073-7-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/machine/machine.py | 18 ------------------ python/qemu/machine/qtest.py | 5 +---- tests/avocado/acpi-bits.py | 5 +---- tests/avocado/avocado_qemu/__init__.py | 2 +- tests/avocado/machine_aspeed.py | 5 ++++- tests/qemu-iotests/iotests.py | 2 +- tests/qemu-iotests/tests/copy-before-write | 3 +-- 7 files changed, 9 insertions(+), 31 deletions(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 4156b8cf7d4..d539e91268a 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -127,7 +127,6 @@ def __init__(self, name: Optional[str] =3D None, base_temp_dir: str =3D "/var/tmp", monitor_address: Optional[SocketAddrT] =3D None, - sock_dir: Optional[str] =3D None, drain_console: bool =3D False, console_log: Optional[str] =3D None, log_dir: Optional[str] =3D None, @@ -141,7 +140,6 @@ def __init__(self, @param name: prefix for socket and log file names (default: qemu-P= ID) @param base_temp_dir: default location where temp files are created @param monitor_address: address for QMP monitor - @param sock_dir: where to create socket (defaults to base_temp_dir) @param drain_console: (optional) True to drain console socket to b= uffer @param console_log: (optional) path to console log file @param log_dir: where to create and keep log files @@ -163,7 +161,6 @@ def __init__(self, Tuple[socket.socket, socket.socket]] =3D None self._temp_dir: Optional[str] =3D None self._base_temp_dir =3D base_temp_dir - self._sock_dir =3D sock_dir self._log_dir =3D log_dir =20 self._monitor_address =3D monitor_address @@ -189,9 +186,6 @@ def __init__(self, self._console_index =3D 0 self._console_set =3D False self._console_device_type: Optional[str] =3D None - self._console_address =3D os.path.join( - self.sock_dir, f"{self._name}.con" - ) self._console_socket: Optional[socket.socket] =3D None self._console_file: Optional[socket.SocketIO] =3D None self._remove_files: List[str] =3D [] @@ -335,9 +329,6 @@ def args(self) -> List[str]: return self._args =20 def _pre_launch(self) -> None: - if self._console_set: - self._remove_files.append(self._console_address) - if self._qmp_set: if self._monitor_address is None: self._sock_pair =3D socket.socketpair() @@ -937,15 +928,6 @@ def temp_dir(self) -> str: dir=3Dself._base_temp_dir) return self._temp_dir =20 - @property - def sock_dir(self) -> str: - """ - Returns the directory used for sockfiles by this machine. - """ - if self._sock_dir: - return self._sock_dir - return self.temp_dir - @property def log_dir(self) -> str: """ diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py index 8180d3ab017..4f5ede85b23 100644 --- a/python/qemu/machine/qtest.py +++ b/python/qemu/machine/qtest.py @@ -135,17 +135,14 @@ def __init__(self, wrapper: Sequence[str] =3D (), name: Optional[str] =3D None, base_temp_dir: str =3D "/var/tmp", - sock_dir: Optional[str] =3D None, qmp_timer: Optional[float] =3D None): # pylint: disable=3Dtoo-many-arguments =20 if name is None: name =3D "qemu-%d" % os.getpid() - if sock_dir is None: - sock_dir =3D base_temp_dir super().__init__(binary, args, wrapper=3Dwrapper, name=3Dname, base_temp_dir=3Dbase_temp_dir, - sock_dir=3Dsock_dir, qmp_timer=3Dqmp_timer) + qmp_timer=3Dqmp_timer) self._qtest: Optional[QEMUQtestProtocol] =3D None self._qtest_sock_pair: Optional[ Tuple[socket.socket, socket.socket]] =3D None diff --git a/tests/avocado/acpi-bits.py b/tests/avocado/acpi-bits.py index bb3f8186899..eca13dc5181 100644 --- a/tests/avocado/acpi-bits.py +++ b/tests/avocado/acpi-bits.py @@ -92,17 +92,14 @@ def __init__(self, base_temp_dir: str =3D "/var/tmp", debugcon_log: str =3D "debugcon-log.txt", debugcon_addr: str =3D "0x403", - sock_dir: Optional[str] =3D None, qmp_timer: Optional[float] =3D None): # pylint: disable=3Dtoo-many-arguments =20 if name is None: name =3D "qemu-bits-%d" % os.getpid() - if sock_dir is None: - sock_dir =3D base_temp_dir super().__init__(binary, args, wrapper=3Dwrapper, name=3Dname, base_temp_dir=3Dbase_temp_dir, - sock_dir=3Dsock_dir, qmp_timer=3Dqmp_timer) + qmp_timer=3Dqmp_timer) self.debugcon_log =3D debugcon_log self.debugcon_addr =3D debugcon_addr self.base_temp_dir =3D base_temp_dir diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado= _qemu/__init__.py index 0172a359b71..0589534f28a 100644 --- a/tests/avocado/avocado_qemu/__init__.py +++ b/tests/avocado/avocado_qemu/__init__.py @@ -322,7 +322,7 @@ def require_multiprocess(self): def _new_vm(self, name, *args): self._sd =3D tempfile.TemporaryDirectory(prefix=3D"qemu_") vm =3D QEMUMachine(self.qemu_bin, base_temp_dir=3Dself.workdir, - sock_dir=3Dself._sd.name, log_dir=3Dself.logdir) + log_dir=3Dself.logdir) self.log.debug('QEMUMachine "%s" created', name) self.log.debug('QEMUMachine "%s" temp_dir: %s', name, vm.temp_dir) self.log.debug('QEMUMachine "%s" log_dir: %s', name, vm.log_dir) diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed= .py index 90f1b7cb77a..f691ee3fb82 100644 --- a/tests/avocado/machine_aspeed.py +++ b/tests/avocado/machine_aspeed.py @@ -247,7 +247,10 @@ def test_arm_ast2600_evb_buildroot_tpm(self): image_path =3D self.fetch_asset(image_url, asset_hash=3Dimage_hash, algorithm=3D'sha256') =20 - socket =3D os.path.join(self.vm.sock_dir, 'swtpm-socket') + # force creation of VM object, which also defines self._sd + vm =3D self.vm + + socket =3D os.path.join(self._sd.name, 'swtpm-socket') =20 subprocess.run(['swtpm', 'socket', '-d', '--tpm2', '--tpmstate', f'dir=3D{self.vm.temp_dir}', diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index ef66fbd62b0..145c6827138 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -823,7 +823,7 @@ def __init__(self, path_suffix=3D''): super().__init__(qemu_prog, qemu_opts, wrapper=3Dwrapper, name=3Dname, base_temp_dir=3Dtest_dir, - sock_dir=3Dsock_dir, qmp_timer=3Dtimer) + qmp_timer=3Dtimer) self._num_drives =3D 0 =20 def _post_shutdown(self) -> None: diff --git a/tests/qemu-iotests/tests/copy-before-write b/tests/qemu-iotest= s/tests/copy-before-write index 2ffe092b318..d3987db9421 100755 --- a/tests/qemu-iotests/tests/copy-before-write +++ b/tests/qemu-iotests/tests/copy-before-write @@ -44,8 +44,7 @@ class TestCbwError(iotests.QMPTestCase): =20 opts =3D ['-nodefaults', '-display', 'none', '-machine', 'none'] self.vm =3D QEMUMachine(iotests.qemu_prog, opts, - base_temp_dir=3Diotests.test_dir, - sock_dir=3Diotests.sock_dir) + base_temp_dir=3Diotests.test_dir) self.vm.launch() =20 def do_cbw_error(self, on_cbw_error): --=20 2.41.0 From nobody Sun May 19 10:14:48 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696448901; cv=none; d=zohomail.com; s=zohoarc; b=eWLDb+S3d7y/3jauff/x2hBIJQejGDlQwoJZ8vM+X5tfBHzmVsLLrGnon2GDThANghWSel9/QQsWqMD9RLShbm0R+aQlKPCyx6osNtrjzkDhDWBWLEL0t8vGM8WldAkunT++PwBPLM33o1BRbGtbFH1uWRTbLQSbditnCl54V0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696448901; h=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=qQJsZrMtJpzIhg4gUKqXc9fp4eSxo3ZE8MOIZ9Pskjs=; b=U7iFwxOJjuc8ENT5R9XhfaD75aUkkXkiZ4YBpaFKFBuYSi5JaNLTpp/OmPlUrlJdRUNCU3+cfOOVzOovGP8Gie6LrGvT04h0mRbjqYi1E0ZxyfUKgtKfdyG7BliCvmb5X2Qs5XaVisswkFKGPLdrVyhq72z5QG8HXI3oHYrFIkc= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696448901484228.85996199308124; Wed, 4 Oct 2023 12:48:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo7pI-0004lP-31; Wed, 04 Oct 2023 15:46:32 -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 1qo7pG-0004kE-Bl for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:30 -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 1qo7pE-0005AU-3E for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:30 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-526-kh1flpC0OjiRnEAaMKYx6g-1; Wed, 04 Oct 2023 15:46:24 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7533685A5BD; Wed, 4 Oct 2023 19:46:23 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.16.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id 924151054FC3; Wed, 4 Oct 2023 19:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696448787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qQJsZrMtJpzIhg4gUKqXc9fp4eSxo3ZE8MOIZ9Pskjs=; b=ARXEoauQFjIM/Mh9LGuBy1FK/mmOeX7S+q4I5ovmVwcNndHzCxOua6K3Rc9aHPnJNpagLS HH1vm0CASS5IS3NdvmcpNbVK0u0OwryrlrJZy8Tw4k5eFylT8iCkQYDvrPlanW7IyCjvCd 8/qMumgAWOXK91xaG8uq42hLJbGer/g= X-MC-Unique: kh1flpC0OjiRnEAaMKYx6g-1 From: John Snow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Wainer dos Santos Moschetta , Kevin Wolf , Andrew Jeffery , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa , Peter Maydell , qemu-arm@nongnu.org, Joel Stanley , qemu-block@nongnu.org, Beraldo Leal , Vladimir Sementsov-Ogievskiy , Hanna Reitz , "Michael S. Tsirkin" , Vladimir Sementsov-Ogievskiy , Thomas Huth , Eric Blake , Ani Sinha , Eduardo Habkost , Markus Armbruster Subject: [PULL 8/9] python/qmp: remove Server.wait_closed() call for Python 3.12 Date: Wed, 4 Oct 2023 15:46:12 -0400 Message-ID: <20231004194613.2900323-9-jsnow@redhat.com> In-Reply-To: <20231004194613.2900323-1-jsnow@redhat.com> References: <20231004194613.2900323-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=jsnow@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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: 1696448902323100001 Content-Type: text/plain; charset="utf-8" This patch is a backport from https://gitlab.com/qemu-project/python-qemu-qmp/-/commit/e03a3334b6a477beb0= 9b293708632f2c06fe9f61 According to Guido in https://github.com/python/cpython/issues/104344 , this call was never meant to wait for the server to shut down - that is handled synchronously - but instead, this waits for all connections to close. Or, it would have, if it wasn't broken since it was introduced. 3.12 fixes the bug, which now causes a hang in our code. The fix is just to remove the wait. Signed-off-by: John Snow --- python/qemu/qmp/protocol.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/qemu/qmp/protocol.py b/python/qemu/qmp/protocol.py index 753182131fd..a4ffdfad51b 100644 --- a/python/qemu/qmp/protocol.py +++ b/python/qemu/qmp/protocol.py @@ -495,7 +495,6 @@ async def _stop_server(self) -> None: try: self.logger.debug("Stopping server.") self._server.close() - await self._server.wait_closed() self.logger.debug("Server stopped.") finally: self._server =3D None --=20 2.41.0 From nobody Sun May 19 10:14:48 2024 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1696448939; cv=none; d=zohomail.com; s=zohoarc; b=Rbh/k9vGcsUW3POnmj/YGoAL8UsjyF0oZWANB76dF2uHKz7ewzYM9N6GCzpLCkpxAfqFrOBGGwk1vFx5Koy6gGrAXcNCW0IxWp00sU/vSB1nQ91DBYqMx5Z+Nwu8uCzj3qzmlrA64oL8UMvASV/xTnJgB7M3WzC7ZBesM4ar0rc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696448939; h=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=Abfte2QvhByUnYhfpgXu9SAU3k87KQBC8t41fRUboEQ=; b=Bp8m2Mc5QumavyNULca+H2jcVtf/38jBuryQBf/uUrb9+vtfC0uaUztAm4T3IxKorrNT/S8XcOuQ1MlSJF87Yw25Z/OcyRXmxY6E/Rk6RNZ7YoXRPyDSD9sGBCw856w3smgzQU6B8rUnAoDGTs+RrOL+N/KZWx7CYmCCB2mMvds= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696448939845583.6277622654426; Wed, 4 Oct 2023 12:48:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo7pL-0004oP-4h; Wed, 04 Oct 2023 15:46:35 -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 1qo7pK-0004nd-36 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:34 -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 1qo7pE-0005BF-W5 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 15:46:33 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-155-WByInjy9PTCHW3JQOUiCHQ-1; Wed, 04 Oct 2023 15:46:25 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6202F2932495; Wed, 4 Oct 2023 19:46:24 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.16.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id 818451054FC3; Wed, 4 Oct 2023 19:46:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696448788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Abfte2QvhByUnYhfpgXu9SAU3k87KQBC8t41fRUboEQ=; b=hNwuGvOsOqkadjgt0T4HTtht9Hk7qIg14LvWFyEf559nB++Aa8/R8SMa7XsqAIi/ZBT2Ul Yt+gTUYQO7euzatbwAnmNW+c7OM42VXDf8/zQUQb37SC6xcy5lec6l4YcFUzN2NLA9EyYl ADF8O3Imf+EWLlo2k5FbDJcbeevQWEs= X-MC-Unique: WByInjy9PTCHW3JQOUiCHQ-1 From: John Snow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Wainer dos Santos Moschetta , Kevin Wolf , Andrew Jeffery , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa , Peter Maydell , qemu-arm@nongnu.org, Joel Stanley , qemu-block@nongnu.org, Beraldo Leal , Vladimir Sementsov-Ogievskiy , Hanna Reitz , "Michael S. Tsirkin" , Vladimir Sementsov-Ogievskiy , Thomas Huth , Eric Blake , Ani Sinha , Eduardo Habkost , Markus Armbruster Subject: [PULL 9/9] Python: test Python 3.12 Date: Wed, 4 Oct 2023 15:46:13 -0400 Message-ID: <20231004194613.2900323-10-jsnow@redhat.com> In-Reply-To: <20231004194613.2900323-1-jsnow@redhat.com> References: <20231004194613.2900323-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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=jsnow@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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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: 1696448941102100007 Content-Type: text/plain; charset="utf-8" Python 3.12 has released, so update the test infrastructure to test against this version. Signed-off-by: John Snow --- python/setup.cfg | 3 ++- tests/docker/dockerfiles/python.docker | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python/setup.cfg b/python/setup.cfg index 8c67dce4579..48668609d3e 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -18,6 +18,7 @@ classifiers =3D Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Typing :: Typed =20 [options] @@ -182,7 +183,7 @@ multi_line_output=3D3 # of python available on your system to run this test. =20 [tox:tox] -envlist =3D py38, py39, py310, py311 +envlist =3D py38, py39, py310, py311, py312 skip_missing_interpreters =3D true =20 [testenv] diff --git a/tests/docker/dockerfiles/python.docker b/tests/docker/dockerfi= les/python.docker index 383ccbdc3a5..a3c1321190c 100644 --- a/tests/docker/dockerfiles/python.docker +++ b/tests/docker/dockerfiles/python.docker @@ -11,7 +11,11 @@ ENV PACKAGES \ python3-pip \ python3-tox \ python3-virtualenv \ - python3.10 + python3.10 \ + python3.11 \ + python3.12 \ + python3.8 \ + python3.9 =20 RUN dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt --=20 2.41.0