From nobody Tue May 21 19:49:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165055478152427.334381960453015; Thu, 21 Apr 2022 08:26:21 -0700 (PDT) Received: from localhost ([::1]:35210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYhI-0004bQ-HW for importer@patchew.org; Thu, 21 Apr 2022 11:26:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXc-0003ka-55 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:21507) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXW-0005pH-09 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:19 -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-417-RdrkahdbOAaQhCGo27wV7w-1; Thu, 21 Apr 2022 11:16:02 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3EF40802819; Thu, 21 Apr 2022 15:16:02 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE9E140D016A; Thu, 21 Apr 2022 15:16:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554173; 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=GzXaTanbvs0aPCypeTjC5Oo4DdPAf2rdQiauUne8//Y=; b=WKMeIEGrAIDoUBR3Ep2uSn5WJAeO78M3Z2A7Ve//ue/7IyVirID0hhNQBtzkIw0Ecr7gS8 oFrhndLCM28EnNWlwWbmfHYvvTd9KqVulNUkXmeklr22F1/OyLT/cLwEey7AHxbuYZvRS1 I9m6MpsMukLpPzVN+NWZPwk+ExIHKgg= X-MC-Unique: RdrkahdbOAaQhCGo27wV7w-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 01/17] python/machine: permanently switch to AQMP Date: Thu, 21 Apr 2022 11:15:44 -0400 Message-Id: <20220421151600.984189-2-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650554782872100001 Content-Type: text/plain; charset="utf-8" Remove the QEMU_PYTHON_LEGACY_QMP environment variable, making the switch from sync qmp to async qmp permanent. Update exceptions and import paths as necessary. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Acked-by: Hanna Reitz Message-id: 20220321203315.909411-2-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/machine/machine.py | 18 +++++++----------- python/qemu/machine/qtest.py | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index a5972fab4d2..41be025ac7b 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -40,21 +40,16 @@ TypeVar, ) =20 -from qemu.qmp import ( # pylint: disable=3Dimport-error +from qemu.aqmp import SocketAddrT +from qemu.aqmp.legacy import ( + QEMUMonitorProtocol, QMPMessage, QMPReturnValue, - SocketAddrT, ) =20 from . import console_socket =20 =20 -if os.environ.get('QEMU_PYTHON_LEGACY_QMP'): - from qemu.qmp import QEMUMonitorProtocol -else: - from qemu.aqmp.legacy import QEMUMonitorProtocol - - LOG =3D logging.getLogger(__name__) =20 =20 @@ -743,8 +738,9 @@ def events_wait(self, :param timeout: Optional timeout, in seconds. See QEMUMonitorProtocol.pull_event. =20 - :raise QMPTimeoutError: If timeout was non-zero and no matching ev= ents - were found. + :raise asyncio.TimeoutError: + If timeout was non-zero and no matching events were found. + :return: A QMP event matching the filter criteria. If timeout was 0 and no event matched, None. """ @@ -767,7 +763,7 @@ def _match(event: QMPMessage) -> bool: event =3D self._qmp.pull_event(wait=3Dtimeout) if event is None: # NB: None is only returned when timeout is false-ish. - # Timeouts raise QMPTimeoutError instead! + # Timeouts raise asyncio.TimeoutError instead! break if _match(event): return event diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py index f2f9aaa5e50..13e0aaff846 100644 --- a/python/qemu/machine/qtest.py +++ b/python/qemu/machine/qtest.py @@ -26,7 +26,7 @@ TextIO, ) =20 -from qemu.qmp import SocketAddrT # pylint: disable=3Dimport-error +from qemu.aqmp import SocketAddrT =20 from .machine import QEMUMachine =20 --=20 2.34.1 From nobody Tue May 21 19:49:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650554319710555.4843528396141; Thu, 21 Apr 2022 08:18:39 -0700 (PDT) Received: from localhost ([::1]:43188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYZp-0006pY-CA for importer@patchew.org; Thu, 21 Apr 2022 11:18:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXU-0003M4-IF for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:56945) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXP-0005mJ-Jh for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:11 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-457--ynYkHinOMKqPD6V8kozrA-1; Thu, 21 Apr 2022 11:16:03 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BDAFB3C1E8E0; Thu, 21 Apr 2022 15:16:02 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D79F40D016A; Thu, 21 Apr 2022 15:16:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554166; 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=jtKbK/vGVVoUuw6SQ9XFFA9R7ww8R8/L0sjErm6vbhU=; b=QtJgzHOUxIk+Ct+u0YCj5ZEj9lladYkAvaPTwiWFj/kFRV+9hHbk8tsK+2qSIYo++OQgCK DF7il0FEdToju2p6qmODKDkUH8OqcTt0kkkEHYE1yRk5UTEGOLYPDtjaaLyYUN5TWuWesu mBcsAoa3J58O9g3fls9/UPUhW6KkvQo= X-MC-Unique: -ynYkHinOMKqPD6V8kozrA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 02/17] scripts/bench-block-job: switch to AQMP Date: Thu, 21 Apr 2022 11:15:45 -0400 Message-Id: <20220421151600.984189-3-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650554322300100001 Content-Type: text/plain; charset="utf-8" For this commit, we only need to remove accommodations for the synchronous QMP library. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Acked-by: Hanna Reitz Message-id: 20220321203315.909411-3-jsnow@redhat.com Signed-off-by: John Snow --- scripts/simplebench/bench_block_job.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/simplebench/bench_block_job.py b/scripts/simplebench/b= ench_block_job.py index a403c35b08f..af9d1646a46 100755 --- a/scripts/simplebench/bench_block_job.py +++ b/scripts/simplebench/bench_block_job.py @@ -27,7 +27,6 @@ =20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu.machine import QEMUMachine -from qemu.qmp import QMPConnectError from qemu.aqmp import ConnectError =20 =20 @@ -50,7 +49,7 @@ def bench_block_job(cmd, cmd_args, qemu_args): vm.launch() except OSError as e: return {'error': 'popen failed: ' + str(e)} - except (QMPConnectError, ConnectError, socket.timeout): + except (ConnectError, socket.timeout): return {'error': 'qemu failed: ' + str(vm.get_log())} =20 try: --=20 2.34.1 From nobody Tue May 21 19:49:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650554752300623.7394699253194; Thu, 21 Apr 2022 08:25:52 -0700 (PDT) Received: from localhost ([::1]:60870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYgp-0002c2-BX for importer@patchew.org; Thu, 21 Apr 2022 11:25:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXV-0003Nf-9j for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:41106) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXP-0005mT-L4 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:12 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-3-H2BsQJsnMF-VnFdzKobAtg-1; Thu, 21 Apr 2022 11:16:03 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 48F013811F2E; Thu, 21 Apr 2022 15:16:03 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD5F640D016A; Thu, 21 Apr 2022 15:16:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554167; 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=pwuEgcRktwwExu5MJhSZZLINFhmagfgwJaOuprPGgaA=; b=RMsWV8wohb+iT/4O33lhWy3wp+dS8/ztdjEssO08l4tzOU5KeWVsnKICrhORmK9wNpzjSq cIiG7xahUuADyI0DNFAnJqNimfy7QLO+61Cc/3CYsQOAaNRQorQZdlHkN6sclKpll1lHfr 8pT+UPurngwgGJBnk+/UOPLzFUm6VAg= X-MC-Unique: H2BsQJsnMF-VnFdzKobAtg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 03/17] iotests/mirror-top-perms: switch to AQMP Date: Thu, 21 Apr 2022 11:15:46 -0400 Message-Id: <20220421151600.984189-4-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650554752611100001 Content-Type: text/plain; charset="utf-8" We don't have to maintain compatibility with both QMP libraries anymore, so we can just remove the old exception. While we're here, take advantage of the extra fields present in the VMLaunchFailure exception that machine.py now raises. (Note: I'm leaving the logging suppression here unchanged. I had suggested previously we use filters to scrub the PID out of the logging information so it could just be diffed as part of the iotest output, but that meant *always* scrubbing PID from logger output, which defeated the point of even offering that information in the output to begin with. Ultimately, I decided it's fine to just suppress the logger temporarily.) Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Acked-by: Hanna Reitz Message-id: 20220321203315.909411-4-jsnow@redhat.com Signed-off-by: John Snow --- tests/qemu-iotests/tests/mirror-top-perms | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/tests/mirror-top-perms b/tests/qemu-iotests= /tests/mirror-top-perms index 6ac8d5efccb..a9f275cd7f2 100755 --- a/tests/qemu-iotests/tests/mirror-top-perms +++ b/tests/qemu-iotests/tests/mirror-top-perms @@ -22,7 +22,6 @@ import os =20 from qemu.machine import machine -from qemu.qmp import QMPConnectError =20 import iotests from iotests import change_log_level, qemu_img @@ -98,15 +97,13 @@ class TestMirrorTopPerms(iotests.QMPTestCase): self.vm_b.add_blockdev(f'file,node-name=3Ddrive0,filename=3D{sourc= e}') self.vm_b.add_device('virtio-blk,drive=3Ddrive0,share-rw=3Don') try: - # Silence AQMP errors temporarily. - # TODO: Remove this and just allow the errors to be logged when - # AQMP fully replaces QMP. + # Silence AQMP logging errors temporarily. with change_log_level('qemu.aqmp'): self.vm_b.launch() print('ERROR: VM B launched successfully, ' 'this should not have happened') - except (QMPConnectError, machine.VMLaunchFailure): - assert 'Is another process using the image' in self.vm_b.get_l= og() + except machine.VMLaunchFailure as exc: + assert 'Is another process using the image' in exc.output =20 result =3D self.vm.qmp('block-job-cancel', device=3D'mirror') --=20 2.34.1 From nobody Tue May 21 19:49:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16505545645351010.48995249264; Thu, 21 Apr 2022 08:22:44 -0700 (PDT) Received: from localhost ([::1]:52284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYdn-00055L-93 for importer@patchew.org; Thu, 21 Apr 2022 11:22:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXV-0003Nm-C9 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:39429) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXQ-0005mm-76 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:13 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-549-9ij-Fm30OgudwNSnoOE7hw-1; Thu, 21 Apr 2022 11:16:04 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CCD033C1E8EA; Thu, 21 Apr 2022 15:16:03 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5966C40D016A; Thu, 21 Apr 2022 15:16:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554167; 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=9T6RxU05PzWWHlYrTypQG8S9sQZPor2x5IVdefW8PgA=; b=YzDjmFQqMByWBLOn0qyk0+b0rcxkpFCuL1ZTjs9lKUkklRiBPaYR/8ntLrHUKoTnreSZSg jgA+RPaWb7T60yTIv4BGibXiP+EG4Oksk7y1cmtDUVc4b7su8ZhAzZVAiTfid/8YRShZFS dunK7RK5q+wrIPkPz7ueGaEnOdt3DA4= X-MC-Unique: 9ij-Fm30OgudwNSnoOE7hw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 04/17] iotests: switch to AQMP Date: Thu, 21 Apr 2022 11:15:47 -0400 Message-Id: <20220421151600.984189-5-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650554565623100001 Content-Type: text/plain; charset="utf-8" iotests is already using async QMP, but to finalize the switchover we only need to update any remaining import paths to rely solely on the new library instead. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Acked-by: Hanna Reitz Message-id: 20220321203315.909411-5-jsnow@redhat.com [Fixed minor rebase conflict. --js] Signed-off-by: John Snow --- tests/qemu-iotests/iotests.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index fe10a6cf05a..6f9aa38e0e8 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -37,9 +37,8 @@ =20 from contextlib import contextmanager =20 -from qemu.aqmp.legacy import QEMUMonitorProtocol +from qemu.aqmp.legacy import QMPMessage, QEMUMonitorProtocol from qemu.machine import qtest -from qemu.qmp import QMPMessage from qemu.utils import VerboseProcessError =20 # Use this logger for logging messages directly from the iotests module --=20 2.34.1 From nobody Tue May 21 19:49:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650554311809315.546203485142; Thu, 21 Apr 2022 08:18:31 -0700 (PDT) Received: from localhost ([::1]:42882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYZh-0006cM-Dx for importer@patchew.org; Thu, 21 Apr 2022 11:18:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXX-0003VL-Vo for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXR-0005nO-FN for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:15 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-322-rjPNp6ltNz2iHszEfLQ0JQ-1; Thu, 21 Apr 2022 11:16:04 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B9081E15C00; Thu, 21 Apr 2022 15:16:04 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAB6540D016A; Thu, 21 Apr 2022 15:16:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554168; 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=dfpU6to8hRGsmwOwt5/Yqz+W2ZLnM77RiuDubpMqLcs=; b=RBBoks0dSdYGidQL3lGFO+clMK5DIgWNfPZ96w52R61kvfPo5kRCbMpxbxftD+oFuxnfA2 RZi0wA9aI62Mv7RbXGW902ulGuNBMvX7r+RIr4jSni/DYw/y9cfxLAjSXB37SPRyJ97tbT avF8IE3VaqenYOH6rCZA10+1AzCBeKE= X-MC-Unique: rjPNp6ltNz2iHszEfLQ0JQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 05/17] python/aqmp: add explicit GPLv2 license to legacy.py Date: Thu, 21 Apr 2022 11:15:48 -0400 Message-Id: <20220421151600.984189-6-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650554314367100001 Content-Type: text/plain; charset="utf-8" The legacy.py module is heavily based on the QMP module by Luiz Capitulino (et al) which is licensed as explicit GPLv2-only. The async QMP package is currently licensed similarly, but I intend to relicense the async package to the more flexible LGPLv2+. In preparation for that change, make the license on legacy.py explicit. Signed-off-by: John Snow Message-id: 20220325200438.2556381-2-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/legacy.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python/qemu/aqmp/legacy.py b/python/qemu/aqmp/legacy.py index 46026e9fdc6..f86cb298049 100644 --- a/python/qemu/aqmp/legacy.py +++ b/python/qemu/aqmp/legacy.py @@ -4,6 +4,17 @@ This class pretends to be qemu.qmp.QEMUMonitorProtocol. """ =20 +# +# Copyright (C) 2009-2022 Red Hat Inc. +# +# Authors: +# Luiz Capitulino +# John Snow +# +# This work is licensed under the terms of the GNU GPL, version 2. See +# the COPYING file in the top-level directory. +# + import asyncio from typing import ( Any, --=20 2.34.1 From nobody Tue May 21 19:50:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650554596724471.556259889516; Thu, 21 Apr 2022 08:23:16 -0700 (PDT) Received: from localhost ([::1]:53810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYeF-0006BI-Cc for importer@patchew.org; Thu, 21 Apr 2022 11:23:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXX-0003Ry-9t for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:29551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXR-0005nG-5T for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:14 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-256-LwfaeX1qPc6YHnRxyFuSCg-1; Thu, 21 Apr 2022 11:16:05 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C367F2808560; Thu, 21 Apr 2022 15:16:04 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A03440D016A; Thu, 21 Apr 2022 15:16:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554168; 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=CPS739JKvKXJsU9GXwhxwx+eiw+cl2oRRPtKLAGc8KI=; b=Encn3sATJQJBIHobxlBuQNQOpY6PkcKHRUXmpwpbdGF+MRrA/EeVmpr3Sw6eZ2F3L3S1vg I4qslWE8nGKM7P8eo2+r5WBjH1rHGLzQpOH6tGCTzfOuAuujlL8ZzIjQ5MHAgQe+P7R0em HunJwdz2t5Fl5KeurdB5y+6sCX9A+xE= X-MC-Unique: LwfaeX1qPc6YHnRxyFuSCg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 06/17] python/aqmp: relicense as LGPLv2+ Date: Thu, 21 Apr 2022 11:15:49 -0400 Message-Id: <20220421151600.984189-7-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650554598281100001 Content-Type: text/plain; charset="utf-8" I am the sole author of all of the async QMP code (python/qemu/aqmp) with the following exceptions: python/qemu/aqmp/qmp_shell.py and python/qemu/aqmp/legacy.py were written by Luiz Capitulino (et al) and are already licensed separately as GPLv2 (only). aqmp_tui.py was written by Niteesh Babu G S and is licensed as GPLv2+. I wish to relicense as LGPLv2+ in order to provide as much flexibility as I reasonably can, while retaining a copyleft license. It is my belief that LGPLv2+ is a suitable license for the Python ecosystem that aligns with the goals and philosophy of the QEMU project. The intent is to eventually drop legacy.py, leaving only library code that is LGPLv2+. Signed-off-by: John Snow Message-id: 20220325200438.2556381-3-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/qemu/aqmp/__init__.py b/python/qemu/aqmp/__init__.py index 4c22c380790..2b69b264f4f 100644 --- a/python/qemu/aqmp/__init__.py +++ b/python/qemu/aqmp/__init__.py @@ -11,15 +11,15 @@ managing QMP events. """ =20 -# Copyright (C) 2020, 2021 John Snow for Red Hat, Inc. +# Copyright (C) 2020-2022 John Snow for Red Hat, Inc. # # Authors: # John Snow # # Based on earlier work by Luiz Capitulino . # -# This work is licensed under the terms of the GNU GPL, version 2. See -# the COPYING file in the top-level directory. +# This work is licensed under the terms of the GNU LGPL, version 2 or +# later. See the COPYING file in the top-level directory. =20 import logging =20 --=20 2.34.1 From nobody Tue May 21 19:50:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650554766741522.7590835410901; Thu, 21 Apr 2022 08:26:06 -0700 (PDT) Received: from localhost ([::1]:34086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYh3-0003ik-NF for importer@patchew.org; Thu, 21 Apr 2022 11:26:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXY-0003Vb-3M for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:58416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXR-0005nU-N2 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:15 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-575-pA8jO-meNbOGRmcvb21vJQ-1; Thu, 21 Apr 2022 11:16:05 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D8161E15C06; Thu, 21 Apr 2022 15:16:05 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id D327340D016E; Thu, 21 Apr 2022 15:16:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554169; 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=dDAexfzuLU0la3BW7me8tQSAM7lY3zYXlhumY7Vbc1Q=; b=ePT+2uqm9J+l+z2gWElUaAPSUSvGzxziVrPuht6r/IRAWF/fBOVOuOdRsWyn5YeGoVJL0p e5ErZu/ZPc2KpsiCCIX3OW/VMHriOIrAOBC26doyogKJVSug268cT9gpIgcocis8YVSqLn ulB9xNoWRWsqMQIrrdZAey1iQEoRVoc= X-MC-Unique: pA8jO-meNbOGRmcvb21vJQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 07/17] python/qmp-shell: relicense as LGPLv2+ Date: Thu, 21 Apr 2022 11:15:50 -0400 Message-Id: <20220421151600.984189-8-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Luiz Capitulino , Eduardo Habkost , Hanna Reitz , Cleber Rosa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Fam Zheng , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650554768843100001 qmp-shell is presently licensed as GPLv2 (only). I intend to include this tool as an add-on to an LGPLv2+ library package hosted on PyPI.org. I've selected LGPLv2+ to maximize compatibility with other licenses while retaining a copyleft license. To keep licensing matters simple, I'd like to relicense this tool as LGPLv2+ as well in order to keep the resultant license of the hosted release files simple -- even if library users won't "link against" this command line tool. Therefore, I am asking permission from the current authors of this tool to loosen the license. At present, those people are: - John Snow (me!), 411/609 - Luiz Capitulino, Author, 97/609 - Daniel Berrang=C3=A9, 81/609 - Eduardo Habkost, 10/609 - Marc-Andr=C3=A9 Lureau, 6/609 - Fam Zheng, 3/609 - Cleber Rosa, 1/609 (All of which appear to have been written under redhat.com addresses.) Eduardo's fixes are largely automated from 2to3 conversion tools and may not necessarily constitute authorship, but his signature would put to rest any questions. Cleber's changes concern a single import statement change. Also won't hurt to ask. Signed-off-by: John Snow Reviewed-by: Marc-Andr=C3=A9 Lureau Acked-by: Fam Zheng Acked-by: Luiz Capitulino Acked-by: Eduardo Habkost Acked-by: Daniel P. Berrang=C3=A9 Acked-by: Cleber Rosa Message-id: 20220325200438.2556381-4-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/qmp_shell.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/qemu/aqmp/qmp_shell.py b/python/qemu/aqmp/qmp_shell.py index 35691494d0a..c23f1b19280 100644 --- a/python/qemu/aqmp/qmp_shell.py +++ b/python/qemu/aqmp/qmp_shell.py @@ -1,11 +1,12 @@ # -# Copyright (C) 2009, 2010 Red Hat Inc. +# Copyright (C) 2009-2022 Red Hat Inc. # # Authors: # Luiz Capitulino +# John Snow # -# This work is licensed under the terms of the GNU GPL, version 2. See -# the COPYING file in the top-level directory. +# This work is licensed under the terms of the GNU LGPL, version 2 or +# later. See the COPYING file in the top-level directory. # =20 """ --=20 2.34.1 From nobody Tue May 21 19:50:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650554911971645.9873136659421; Thu, 21 Apr 2022 08:28:31 -0700 (PDT) Received: from localhost ([::1]:42622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYjO-0001ix-Sz for importer@patchew.org; Thu, 21 Apr 2022 11:28:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXY-0003Wf-Bw for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXS-0005nc-Bd for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:16 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-224-Jk8DL4v8OYiRD3E982zvNA-1; Thu, 21 Apr 2022 11:16:06 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EDB973C1E8E8; Thu, 21 Apr 2022 15:16:05 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B78E40D016A; Thu, 21 Apr 2022 15:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554169; 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=RC99QeCbJTpA4Y7YOyP4tSxhIVIUXbOKhrPiEE81afg=; b=c7Fa/CpKAwJ61jwfxMua7IkFOnYfLaIblE7N0psqJLB36wdHEtzerb7d2WbhDjS31CZsG1 TNe4W+Ltopsx/YDRD9WOoNqUKckroWyv0sKXBrPrmKs+IbxRLzs/LtabR3CIyA3DG8oOv8 O33MrVjwkdtkhG20ELWeSmEh5gr4F2k= X-MC-Unique: Jk8DL4v8OYiRD3E982zvNA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 08/17] python/aqmp-tui: relicense as LGPLv2+ Date: Thu, 21 Apr 2022 11:15:51 -0400 Message-Id: <20220421151600.984189-9-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , G S Niteesh Babu , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650554913226100001 Content-Type: text/plain; charset="utf-8" aqmp-tui, the async QMP text user interface tool, is presently licensed as GPLv2+. I intend to include this tool as an add-on to an LGPLv2+ library package hosted on PyPI.org. I've selected LGPLv2+ to maximize compatibility with other licenses while retaining a copyleft license. To keep licensing matters simple, I'd like to relicense this tool as LGPLv2+ as well in order to keep the resultant license of the hosted release files simple -- even if library users won't "link against" this command line tool. Therefore, I am asking permission to loosen the license. Niteesh is effectively the sole author of this code, with scattered lines from myself. Signed-off-by: John Snow Reviewed-by: G S Niteesh Babu Message-id: 20220325200438.2556381-5-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/aqmp_tui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/qemu/aqmp/aqmp_tui.py b/python/qemu/aqmp/aqmp_tui.py index f1e926dd756..946ba9af24e 100644 --- a/python/qemu/aqmp/aqmp_tui.py +++ b/python/qemu/aqmp/aqmp_tui.py @@ -3,7 +3,7 @@ # Authors: # Niteesh Babu G S # -# This work is licensed under the terms of the GNU GPL, version 2 or +# This work is licensed under the terms of the GNU LGPL, version 2 or # later. See the COPYING file in the top-level directory. """ AQMP TUI --=20 2.34.1 From nobody Tue May 21 19:50:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650554397661500.6393842922589; Thu, 21 Apr 2022 08:19:57 -0700 (PDT) Received: from localhost ([::1]:44946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYb6-00084A-EB for importer@patchew.org; Thu, 21 Apr 2022 11:19:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXW-0003Rg-R0 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:54382) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXQ-0005n7-PY for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:14 -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-655-dqRzuFbDM3SRsrM5ATZeJQ-1; Thu, 21 Apr 2022 11:16:07 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7DBAA1014A66; Thu, 21 Apr 2022 15:16:06 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 070AC40D016A; Thu, 21 Apr 2022 15:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554168; 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=UZpYjYmkQdxxTMsFybgk7JKFyXqlK7dc9B0geYKfyVE=; b=MINfR+RBz+GCZLg5pNnPiGVCQPg64FRd0XMgQF4IFj0VJjv+FP/AAi/O7NuDtu9BeXmWP/ jrVPK/z4k8UgGdMs9aRnkiVK1C9w0Xa0dElKXUKDGAoWx+fzMc3ZtENrXgyNG5bRmPuu5G eFqkbGjGwVdjAWwV2znO5GFRAUD63zw= X-MC-Unique: dqRzuFbDM3SRsrM5ATZeJQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 09/17] python: temporarily silence pylint duplicate-code warnings Date: Thu, 21 Apr 2022 11:15:52 -0400 Message-Id: <20220421151600.984189-10-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650554398502100001 Content-Type: text/plain; charset="utf-8" The next several commits copy some code from qemu.qmp to qemu.aqmp, then delete qemu.qmp. In the interim, to prevent test failures, the duplicate code detection needs to be silenced to prevent bisect problems with CI testing. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20220330172812.3427355-2-jsnow@redhat.com Signed-off-by: John Snow --- python/setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/python/setup.cfg b/python/setup.cfg index 241f243e8b9..cdeced44d2b 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -119,6 +119,7 @@ disable=3Dconsider-using-f-string, too-many-function-args, # mypy handles this with less false posit= ives. too-many-instance-attributes, no-member, # mypy also handles this better. + duplicate-code, # To be removed by the end of this patch series. =20 [pylint.basic] # Good variable names which should always be accepted, separated by a comm= a. --=20 2.34.1 From nobody Tue May 21 19:50:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650554919129798.4354188988854; Thu, 21 Apr 2022 08:28:39 -0700 (PDT) Received: from localhost ([::1]:43200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYjW-00026S-0V for importer@patchew.org; Thu, 21 Apr 2022 11:28:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXZ-0003bK-M9 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:51791) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXU-0005o3-0z for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:17 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-475-i2zlULzKNDSIRB0fnxIxjA-1; Thu, 21 Apr 2022 11:16:07 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0AF413811F2D; Thu, 21 Apr 2022 15:16:07 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E75640D016E; Thu, 21 Apr 2022 15:16:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554170; 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=De8dZw0bbkZLJg8Ef8RNcja9f7rKLvmtPt3ZklVYdw0=; b=ZkRXZRgX+hJwgJQaylJvdqN+pu/spOT09Dnp1HhN76bOZZhHp4gTqlcw9GYRKeZfSZYU6e Fv3xN7ej5xCTXXKb2IH4dOIrZyIl2aeZP2IuzznYjE2qW2S1zAxZ0wtzu2Q0groRf7QsSX TLuzL3LOXFZwL7RDT1jS/SCZKOB/uDQ= X-MC-Unique: i2zlULzKNDSIRB0fnxIxjA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 10/17] python/aqmp: take QMPBadPortError and parse_address from qemu.qmp Date: Thu, 21 Apr 2022 11:15:53 -0400 Message-Id: <20220421151600.984189-11-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650554921177100001 Content-Type: text/plain; charset="utf-8" Shift these definitions over from the qmp package to the async qmp package. (Licensing: this is a lateral move, from GPLv2 (only) to GPLv2 (only)) Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Message-id: 20220330172812.3427355-3-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/aqmp_tui.py | 3 +-- python/qemu/aqmp/legacy.py | 30 ++++++++++++++++++++++++++---- python/qemu/qmp/__init__.py | 26 -------------------------- 3 files changed, 27 insertions(+), 32 deletions(-) diff --git a/python/qemu/aqmp/aqmp_tui.py b/python/qemu/aqmp/aqmp_tui.py index 946ba9af24e..59d3036be38 100644 --- a/python/qemu/aqmp/aqmp_tui.py +++ b/python/qemu/aqmp/aqmp_tui.py @@ -35,9 +35,8 @@ import urwid import urwid_readline =20 -from qemu.qmp import QEMUMonitorProtocol, QMPBadPortError - from .error import ProtocolError +from .legacy import QEMUMonitorProtocol, QMPBadPortError from .message import DeserializationError, Message, UnexpectedTypeError from .protocol import ConnectError, Runstate from .qmp_client import ExecInterruptedError, QMPClient diff --git a/python/qemu/aqmp/legacy.py b/python/qemu/aqmp/legacy.py index f86cb298049..f0262749491 100644 --- a/python/qemu/aqmp/legacy.py +++ b/python/qemu/aqmp/legacy.py @@ -33,9 +33,6 @@ from .qmp_client import QMPClient =20 =20 -# (Temporarily) Re-export QMPBadPortError -QMPBadPortError =3D qemu.qmp.QMPBadPortError - #: QMPMessage is an entire QMP message of any kind. QMPMessage =3D Dict[str, Any] =20 @@ -56,6 +53,12 @@ # pylint: disable=3Dmissing-docstring =20 =20 +class QMPBadPortError(QMPError): + """ + Unable to parse socket address: Port was non-numerical. + """ + + class QEMUMonitorProtocol(qemu.qmp.QEMUMonitorProtocol): def __init__(self, address: SocketAddrT, server: bool =3D False, @@ -86,7 +89,26 @@ def _get_greeting(self) -> Optional[QMPMessage]: return None =20 # __enter__ and __exit__ need no changes - # parse_address needs no changes + + @classmethod + def parse_address(cls, address: str) -> SocketAddrT: + """ + Parse a string into a QMP address. + + Figure out if the argument is in the port:host form. + If it's not, it's probably a file path. + """ + components =3D address.split(':') + if len(components) =3D=3D 2: + try: + port =3D int(components[1]) + except ValueError: + msg =3D f"Bad port: '{components[1]}' in '{address}'." + raise QMPBadPortError(msg) from None + return (components[0], port) + + # Treat as filepath. + return address =20 def connect(self, negotiate: bool =3D True) -> Optional[QMPMessage]: self._aqmp.await_greeting =3D negotiate diff --git a/python/qemu/qmp/__init__.py b/python/qemu/qmp/__init__.py index 358c0971d06..4e086411544 100644 --- a/python/qemu/qmp/__init__.py +++ b/python/qemu/qmp/__init__.py @@ -102,12 +102,6 @@ def __init__(self, reply: QMPMessage): self.reply =3D reply =20 =20 -class QMPBadPortError(QMPError): - """ - Unable to parse socket address: Port was non-numerical. - """ - - class QEMUMonitorProtocol: """ Provide an API to connect to QEMU via QEMU Monitor Protocol (QMP) and = then @@ -237,26 +231,6 @@ def __exit__(self, # Implement context manager exit function. self.close() =20 - @classmethod - def parse_address(cls, address: str) -> SocketAddrT: - """ - Parse a string into a QMP address. - - Figure out if the argument is in the port:host form. - If it's not, it's probably a file path. - """ - components =3D address.split(':') - if len(components) =3D=3D 2: - try: - port =3D int(components[1]) - except ValueError: - msg =3D f"Bad port: '{components[1]}' in '{address}'." - raise QMPBadPortError(msg) from None - return (components[0], port) - - # Treat as filepath. - return address - def connect(self, negotiate: bool =3D True) -> Optional[QMPMessage]: """ Connect to the QMP Monitor and perform capabilities negotiation. --=20 2.34.1 From nobody Tue May 21 19:50:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650554566094958.6550235232166; Thu, 21 Apr 2022 08:22:46 -0700 (PDT) Received: from localhost ([::1]:52410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYdp-00059o-1b for importer@patchew.org; Thu, 21 Apr 2022 11:22:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXa-0003g6-N1 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXU-0005o8-Pg for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:18 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-518-XFW1MtoPMy-6j7AfDQK8QQ-1; Thu, 21 Apr 2022 11:16:08 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8B4003C1E8EC; Thu, 21 Apr 2022 15:16:07 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1891340D016A; Thu, 21 Apr 2022 15:16:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554171; 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=2ME+/WcDKvJomDQ4P/h9DJ6AVEG1Hai+PPCl2ZCbZvY=; b=ZxtBQ+1hca7HYBVlzFaMEuADBGbHNuPIH9RFM6n5tM7vX/LpsTszQXymGvhUqh2U/yRCr8 QscigytovAGUPMyJQsBhW2cHFq1iatADf5NNGOq3GInM6qWKCK8o1E2kzJ/XxqEvgm9txs uPDa0BCks+/FGeIT7DjJx5apMNiF1zI= X-MC-Unique: XFW1MtoPMy-6j7AfDQK8QQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 11/17] python/aqmp: fully separate from qmp.QEMUMonitorProtocol Date: Thu, 21 Apr 2022 11:15:54 -0400 Message-Id: <20220421151600.984189-12-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650554567649100001 Content-Type: text/plain; charset="utf-8" After this patch, qemu.aqmp.legacy.QEMUMonitorProtocol no longer inherits from qemu.qmp.QEMUMonitorProtocol. To do this, several inherited methods need to be explicitly re-defined. (Licensing: This is copying and modifying GPLv2-only code into a GPLv2-only file.) Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Message-id: 20220330172812.3427355-4-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/legacy.py | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/python/qemu/aqmp/legacy.py b/python/qemu/aqmp/legacy.py index f0262749491..10c7c99c4f0 100644 --- a/python/qemu/aqmp/legacy.py +++ b/python/qemu/aqmp/legacy.py @@ -16,18 +16,18 @@ # =20 import asyncio +from types import TracebackType from typing import ( Any, Awaitable, Dict, List, Optional, + Type, TypeVar, Union, ) =20 -import qemu.qmp - from .error import QMPError from .protocol import Runstate, SocketAddrT from .qmp_client import QMPClient @@ -59,12 +59,11 @@ class QMPBadPortError(QMPError): """ =20 =20 -class QEMUMonitorProtocol(qemu.qmp.QEMUMonitorProtocol): +class QEMUMonitorProtocol: def __init__(self, address: SocketAddrT, server: bool =3D False, nickname: Optional[str] =3D None): =20 - # pylint: disable=3Dsuper-init-not-called self._aqmp =3D QMPClient(nickname) self._aloop =3D asyncio.get_event_loop() self._address =3D address @@ -88,7 +87,18 @@ def _get_greeting(self) -> Optional[QMPMessage]: return self._aqmp.greeting._asdict() return None =20 - # __enter__ and __exit__ need no changes + def __enter__(self: _T) -> _T: + # Implement context manager enter function. + return self + + def __exit__(self, + # pylint: disable=3Dduplicate-code + # see https://github.com/PyCQA/pylint/issues/3619 + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType]) -> None: + # Implement context manager exit function. + self.close() =20 @classmethod def parse_address(cls, address: str) -> SocketAddrT: @@ -142,7 +152,22 @@ def cmd_obj(self, qmp_cmd: QMPMessage) -> QMPMessage: ) ) =20 - # Default impl of cmd() delegates to cmd_obj + def cmd(self, name: str, + args: Optional[Dict[str, object]] =3D None, + cmd_id: Optional[object] =3D None) -> QMPMessage: + """ + Build a QMP command and send it to the QMP Monitor. + + @param name: command name (string) + @param args: command arguments (dict) + @param cmd_id: command id (dict, list, string or int) + """ + qmp_cmd: QMPMessage =3D {'execute': name} + if args: + qmp_cmd['arguments'] =3D args + if cmd_id: + qmp_cmd['id'] =3D cmd_id + return self.cmd_obj(qmp_cmd) =20 def command(self, cmd: str, **kwds: object) -> QMPReturnValue: return self._sync( --=20 2.34.1 From nobody Tue May 21 19:50:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650555179111932.9414308877782; Thu, 21 Apr 2022 08:32:59 -0700 (PDT) Received: from localhost ([::1]:51308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYni-0008FI-3m for importer@patchew.org; Thu, 21 Apr 2022 11:32:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXY-0003YG-PE for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41641) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXS-0005ne-D8 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:16 -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-586-qQo8_K4mMGWnC_nga37tKQ-1; Thu, 21 Apr 2022 11:16:08 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 120661018AA4; Thu, 21 Apr 2022 15:16:08 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9969540D016A; Thu, 21 Apr 2022 15:16:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554169; 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=1KnvmcdKVtCg0UkQM1yoPc6euUdvi2n4o1m4tuxnDSs=; b=EwiCnTfOnHDCMFsRR7t3I3KOc7OWFWVeS9Mf8Bi4xH3hAxhhSeJAYkNGOtC1GFuDp2SdYz Ngvdtoge8LuLahSniN75SHdNkXx6vUT6IhTytsfLkDvcAhH4x7oNQbu4EyoY5Mr0DUmBfP G2k2dCpxTYvEC5qb8GsCQb3AlkRKWAw= X-MC-Unique: qQo8_K4mMGWnC_nga37tKQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 12/17] python/aqmp: copy qmp docstrings to qemu.aqmp.legacy Date: Thu, 21 Apr 2022 11:15:55 -0400 Message-Id: <20220421151600.984189-13-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650555181154100001 Content-Type: text/plain; charset="utf-8" Copy the docstrings out of qemu.qmp, adjusting them as necessary to more accurately reflect the current state of this class. (Licensing: This is copying and modifying GPLv2-only licensed docstrings into a GPLv2-only file.) Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Message-id: 20220330172812.3427355-5-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/aqmp/legacy.py | 98 ++++++++++++++++++++++++++++++++++---- 1 file changed, 90 insertions(+), 8 deletions(-) diff --git a/python/qemu/aqmp/legacy.py b/python/qemu/aqmp/legacy.py index 10c7c99c4f0..dfcd20bbd23 100644 --- a/python/qemu/aqmp/legacy.py +++ b/python/qemu/aqmp/legacy.py @@ -1,7 +1,13 @@ """ -Sync QMP Wrapper +(Legacy) Sync QMP Wrapper =20 -This class pretends to be qemu.qmp.QEMUMonitorProtocol. +This module provides the `QEMUMonitorProtocol` class, which is a +synchronous wrapper around `QMPClient`. + +Its design closely resembles that of the original QEMUMonitorProtocol +class, originally written by Luiz Capitulino. It is provided here for +compatibility with scripts inside the QEMU source tree that expect the +old interface. """ =20 # @@ -50,9 +56,6 @@ # {} is the QMPReturnValue. =20 =20 -# pylint: disable=3Dmissing-docstring - - class QMPBadPortError(QMPError): """ Unable to parse socket address: Port was non-numerical. @@ -60,6 +63,17 @@ class QMPBadPortError(QMPError): =20 =20 class QEMUMonitorProtocol: + """ + Provide an API to connect to QEMU via QEMU Monitor Protocol (QMP) + and then allow to handle commands and events. + + :param address: QEMU address, can be either a unix socket path (strin= g) + or a tuple in the form ( address, port ) for a TCP + connection + :param server: Act as the socket server. (See 'accept') + :param nickname: Optional nickname used for logging. + """ + def __init__(self, address: SocketAddrT, server: bool =3D False, nickname: Optional[str] =3D None): @@ -121,6 +135,12 @@ def parse_address(cls, address: str) -> SocketAddrT: return address =20 def connect(self, negotiate: bool =3D True) -> Optional[QMPMessage]: + """ + Connect to the QMP Monitor and perform capabilities negotiation. + + :return: QMP greeting dict, or None if negotiate is false + :raise ConnectError: on connection errors + """ self._aqmp.await_greeting =3D negotiate self._aqmp.negotiate =3D negotiate =20 @@ -130,6 +150,16 @@ def connect(self, negotiate: bool =3D True) -> Optiona= l[QMPMessage]: return self._get_greeting() =20 def accept(self, timeout: Optional[float] =3D 15.0) -> QMPMessage: + """ + Await connection from QMP Monitor and perform capabilities negotia= tion. + + :param timeout: + timeout in seconds (nonnegative float number, or None). + If None, there is no timeout, and this may block forever. + + :return: QMP greeting dict + :raise ConnectError: on connection errors + """ self._aqmp.await_greeting =3D True self._aqmp.negotiate =3D True =20 @@ -140,6 +170,12 @@ def accept(self, timeout: Optional[float] =3D 15.0) ->= QMPMessage: return ret =20 def cmd_obj(self, qmp_cmd: QMPMessage) -> QMPMessage: + """ + Send a QMP command to the QMP Monitor. + + :param qmp_cmd: QMP command to be sent as a Python dict + :return: QMP response as a Python dict + """ return dict( self._sync( # pylint: disable=3Dprotected-access @@ -158,9 +194,9 @@ def cmd(self, name: str, """ Build a QMP command and send it to the QMP Monitor. =20 - @param name: command name (string) - @param args: command arguments (dict) - @param cmd_id: command id (dict, list, string or int) + :param name: command name (string) + :param args: command arguments (dict) + :param cmd_id: command id (dict, list, string or int) """ qmp_cmd: QMPMessage =3D {'execute': name} if args: @@ -170,6 +206,9 @@ def cmd(self, name: str, return self.cmd_obj(qmp_cmd) =20 def command(self, cmd: str, **kwds: object) -> QMPReturnValue: + """ + Build and send a QMP command to the monitor, report errors if any + """ return self._sync( self._aqmp.execute(cmd, kwds), self._timeout @@ -177,6 +216,19 @@ def command(self, cmd: str, **kwds: object) -> QMPRetu= rnValue: =20 def pull_event(self, wait: Union[bool, float] =3D False) -> Optional[QMPMess= age]: + """ + Pulls a single event. + + :param wait: + If False or 0, do not wait. Return None if no events ready. + If True, wait forever until the next event. + Otherwise, wait for the specified number of seconds. + + :raise asyncio.TimeoutError: + When a timeout is requested and the timeout period elapses. + + :return: The first available QMP event, or None. + """ if not wait: # wait is False/0: "do not wait, do not except." if self._aqmp.events.empty(): @@ -197,6 +249,20 @@ def pull_event(self, ) =20 def get_events(self, wait: Union[bool, float] =3D False) -> List[QMPMe= ssage]: + """ + Get a list of QMP events and clear all pending events. + + :param wait: + If False or 0, do not wait. Return None if no events ready. + If True, wait until we have at least one event. + Otherwise, wait for up to the specified number of seconds for = at + least one event. + + :raise asyncio.TimeoutError: + When a timeout is requested and the timeout period elapses. + + :return: A list of QMP events. + """ events =3D [dict(x) for x in self._aqmp.events.clear()] if events: return events @@ -205,17 +271,33 @@ def get_events(self, wait: Union[bool, float] =3D Fal= se) -> List[QMPMessage]: return [event] if event is not None else [] =20 def clear_events(self) -> None: + """Clear current list of pending events.""" self._aqmp.events.clear() =20 def close(self) -> None: + """Close the connection.""" self._sync( self._aqmp.disconnect() ) =20 def settimeout(self, timeout: Optional[float]) -> None: + """ + Set the timeout for QMP RPC execution. + + This timeout affects the `cmd`, `cmd_obj`, and `command` methods. + The `accept`, `pull_event` and `get_event` methods have their + own configurable timeouts. + + :param timeout: + timeout in seconds, or None. + None will wait indefinitely. + """ self._timeout =3D timeout =20 def send_fd_scm(self, fd: int) -> None: + """ + Send a file descriptor to the remote via SCM_RIGHTS. + """ self._aqmp.send_fd_scm(fd) =20 def __del__(self) -> None: --=20 2.34.1 From nobody Tue May 21 19:50:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650555199208887.5520949579197; Thu, 21 Apr 2022 08:33:19 -0700 (PDT) Received: from localhost ([::1]:52716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYo1-00015m-Lt for importer@patchew.org; Thu, 21 Apr 2022 11:33:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXd-0003pE-Hf for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXW-0005pG-1L for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:21 -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-592-DnE2N4eFOXSxnDfAi8t4hA-1; Thu, 21 Apr 2022 11:16:09 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9C41E1815CFA; Thu, 21 Apr 2022 15:16:08 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2015040D016A; Thu, 21 Apr 2022 15:16:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554173; 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=bTGdixfWR1PNir2LvH7KJ8M3T7qE7uzhgvv2MYlhnZs=; b=ibmCvq61Cbv2G5R0sNJwZjL90b+dHfcYcr1/KAArAOcXiK55SBWRBHrLn2HNo5KyRoq93+ TbFBeHSKjzwIgukGcb0BzRyKvgNMGX6rKbS/e3LuLbCFOyebMIyiIy60kI/FW4yI1nI4AB N97XxiFbT3sk+BJwYf/vuxcYyuATZsQ= X-MC-Unique: DnE2N4eFOXSxnDfAi8t4hA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 13/17] python: remove the old QMP package Date: Thu, 21 Apr 2022 11:15:56 -0400 Message-Id: <20220421151600.984189-14-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650555201049100001 Content-Type: text/plain; charset="utf-8" Thank you for your service! Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Message-id: 20220330172812.3427355-6-jsnow@redhat.com Signed-off-by: John Snow --- python/PACKAGE.rst | 4 +- python/README.rst | 2 +- python/qemu/qmp/README.rst | 9 - python/qemu/qmp/__init__.py | 396 ------------------------------------ python/qemu/qmp/py.typed | 0 python/setup.cfg | 3 +- 6 files changed, 4 insertions(+), 410 deletions(-) delete mode 100644 python/qemu/qmp/README.rst delete mode 100644 python/qemu/qmp/__init__.py delete mode 100644 python/qemu/qmp/py.typed diff --git a/python/PACKAGE.rst b/python/PACKAGE.rst index b0b86cc4c31..ddfa9ba3f59 100644 --- a/python/PACKAGE.rst +++ b/python/PACKAGE.rst @@ -8,11 +8,11 @@ to change at any time. Usage ----- =20 -The ``qemu.qmp`` subpackage provides a library for communicating with +The ``qemu.aqmp`` subpackage provides a library for communicating with QMP servers. The ``qemu.machine`` subpackage offers rudimentary facilities for launching and managing QEMU processes. Refer to each package's documentation -(``>>> help(qemu.qmp)``, ``>>> help(qemu.machine)``) +(``>>> help(qemu.aqmp)``, ``>>> help(qemu.machine)``) for more information. =20 Contributing diff --git a/python/README.rst b/python/README.rst index fcf74f69eae..eb5213337d2 100644 --- a/python/README.rst +++ b/python/README.rst @@ -3,7 +3,7 @@ QEMU Python Tooling =20 This directory houses Python tooling used by the QEMU project to build, configure, and test QEMU. It is organized by namespace (``qemu``), and -then by package (e.g. ``qemu/machine``, ``qemu/qmp``, etc). +then by package (e.g. ``qemu/machine``, ``qemu/aqmp``, etc). =20 ``setup.py`` is used by ``pip`` to install this tooling to the current environment. ``setup.cfg`` provides the packaging configuration used by diff --git a/python/qemu/qmp/README.rst b/python/qemu/qmp/README.rst deleted file mode 100644 index 5bfb82535f8..00000000000 --- a/python/qemu/qmp/README.rst +++ /dev/null @@ -1,9 +0,0 @@ -qemu.qmp package -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -This package provides a library used for connecting to and communicating -with QMP servers. It is used extensively by iotests, vm tests, -avocado tests, and other utilities in the ./scripts directory. It is -not a fully-fledged SDK and is subject to change at any time. - -See the documentation in ``__init__.py`` for more information. diff --git a/python/qemu/qmp/__init__.py b/python/qemu/qmp/__init__.py deleted file mode 100644 index 4e086411544..00000000000 --- a/python/qemu/qmp/__init__.py +++ /dev/null @@ -1,396 +0,0 @@ -""" -QEMU Monitor Protocol (QMP) development library & tooling. - -This package provides a fairly low-level class for communicating to QMP -protocol servers, as implemented by QEMU, the QEMU Guest Agent, and the -QEMU Storage Daemon. This library is not intended for production use. - -`QEMUMonitorProtocol` is the primary class of interest, and all errors -raised derive from `QMPError`. -""" - -# Copyright (C) 2009, 2010 Red Hat Inc. -# -# Authors: -# Luiz Capitulino -# -# This work is licensed under the terms of the GNU GPL, version 2. See -# the COPYING file in the top-level directory. - -import errno -import json -import logging -import socket -import struct -from types import TracebackType -from typing import ( - Any, - Dict, - List, - Optional, - TextIO, - Tuple, - Type, - TypeVar, - Union, - cast, -) - - -#: QMPMessage is an entire QMP message of any kind. -QMPMessage =3D Dict[str, Any] - -#: QMPReturnValue is the 'return' value of a command. -QMPReturnValue =3D object - -#: QMPObject is any object in a QMP message. -QMPObject =3D Dict[str, object] - -# QMPMessage can be outgoing commands or incoming events/returns. -# QMPReturnValue is usually a dict/json object, but due to QAPI's -# 'returns-whitelist', it can actually be anything. -# -# {'return': {}} is a QMPMessage, -# {} is the QMPReturnValue. - - -InternetAddrT =3D Tuple[str, int] -UnixAddrT =3D str -SocketAddrT =3D Union[InternetAddrT, UnixAddrT] - - -class QMPError(Exception): - """ - QMP base exception - """ - - -class QMPConnectError(QMPError): - """ - QMP connection exception - """ - - -class QMPCapabilitiesError(QMPError): - """ - QMP negotiate capabilities exception - """ - - -class QMPTimeoutError(QMPError): - """ - QMP timeout exception - """ - - -class QMPProtocolError(QMPError): - """ - QMP protocol error; unexpected response - """ - - -class QMPResponseError(QMPError): - """ - Represents erroneous QMP monitor reply - """ - def __init__(self, reply: QMPMessage): - try: - desc =3D reply['error']['desc'] - except KeyError: - desc =3D reply - super().__init__(desc) - self.reply =3D reply - - -class QEMUMonitorProtocol: - """ - Provide an API to connect to QEMU via QEMU Monitor Protocol (QMP) and = then - allow to handle commands and events. - """ - - #: Logger object for debugging messages - logger =3D logging.getLogger('QMP') - - def __init__(self, address: SocketAddrT, - server: bool =3D False, - nickname: Optional[str] =3D None): - """ - Create a QEMUMonitorProtocol class. - - @param address: QEMU address, can be either a unix socket path (st= ring) - or a tuple in the form ( address, port ) for a TCP - connection - @param server: server mode listens on the socket (bool) - @raise OSError on socket connection errors - @note No connection is established, this is done by the connect() = or - accept() methods - """ - self.__events: List[QMPMessage] =3D [] - self.__address =3D address - self.__sock =3D self.__get_sock() - self.__sockfile: Optional[TextIO] =3D None - self._nickname =3D nickname - if self._nickname: - self.logger =3D logging.getLogger('QMP').getChild(self._nickna= me) - if server: - self.__sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,= 1) - self.__sock.bind(self.__address) - self.__sock.listen(1) - - def __get_sock(self) -> socket.socket: - if isinstance(self.__address, tuple): - family =3D socket.AF_INET - else: - family =3D socket.AF_UNIX - return socket.socket(family, socket.SOCK_STREAM) - - def __negotiate_capabilities(self) -> QMPMessage: - greeting =3D self.__json_read() - if greeting is None or "QMP" not in greeting: - raise QMPConnectError - # Greeting seems ok, negotiate capabilities - resp =3D self.cmd('qmp_capabilities') - if resp and "return" in resp: - return greeting - raise QMPCapabilitiesError - - def __json_read(self, only_event: bool =3D False) -> Optional[QMPMessa= ge]: - assert self.__sockfile is not None - while True: - data =3D self.__sockfile.readline() - if not data: - return None - # By definition, any JSON received from QMP is a QMPMessage, - # and we are asserting only at static analysis time that it - # has a particular shape. - resp: QMPMessage =3D json.loads(data) - if 'event' in resp: - self.logger.debug("<<< %s", resp) - self.__events.append(resp) - if not only_event: - continue - return resp - - def __get_events(self, wait: Union[bool, float] =3D False) -> None: - """ - Check for new events in the stream and cache them in __events. - - @param wait (bool): block until an event is available. - @param wait (float): If wait is a float, treat it as a timeout val= ue. - - @raise QMPTimeoutError: If a timeout float is provided and the tim= eout - period elapses. - @raise QMPConnectError: If wait is True but no events could be - retrieved or if some other error occurred. - """ - - # Current timeout and blocking status - current_timeout =3D self.__sock.gettimeout() - - # Check for new events regardless and pull them into the cache: - self.__sock.settimeout(0) # i.e. setblocking(False) - try: - self.__json_read() - except OSError as err: - # EAGAIN: No data available; not critical - if err.errno !=3D errno.EAGAIN: - raise - finally: - self.__sock.settimeout(current_timeout) - - # Wait for new events, if needed. - # if wait is 0.0, this means "no wait" and is also implicitly fals= e. - if not self.__events and wait: - if isinstance(wait, float): - self.__sock.settimeout(wait) - try: - ret =3D self.__json_read(only_event=3DTrue) - except socket.timeout as err: - raise QMPTimeoutError("Timeout waiting for event") from err - except Exception as err: - msg =3D "Error while reading from socket" - raise QMPConnectError(msg) from err - finally: - self.__sock.settimeout(current_timeout) - - if ret is None: - raise QMPConnectError("Error while reading from socket") - - T =3D TypeVar('T') - - def __enter__(self: T) -> T: - # Implement context manager enter function. - return self - - def __exit__(self, - # pylint: disable=3Dduplicate-code - # see https://github.com/PyCQA/pylint/issues/3619 - exc_type: Optional[Type[BaseException]], - exc_val: Optional[BaseException], - exc_tb: Optional[TracebackType]) -> None: - # Implement context manager exit function. - self.close() - - def connect(self, negotiate: bool =3D True) -> Optional[QMPMessage]: - """ - Connect to the QMP Monitor and perform capabilities negotiation. - - @return QMP greeting dict, or None if negotiate is false - @raise OSError on socket connection errors - @raise QMPConnectError if the greeting is not received - @raise QMPCapabilitiesError if fails to negotiate capabilities - """ - self.__sock.connect(self.__address) - self.__sockfile =3D self.__sock.makefile(mode=3D'r') - if negotiate: - return self.__negotiate_capabilities() - return None - - def accept(self, timeout: Optional[float] =3D 15.0) -> QMPMessage: - """ - Await connection from QMP Monitor and perform capabilities negotia= tion. - - @param timeout: timeout in seconds (nonnegative float number, or - None). The value passed will set the behavior of t= he - underneath QMP socket as described in [1]. - Default value is set to 15.0. - - @return QMP greeting dict - @raise OSError on socket connection errors - @raise QMPConnectError if the greeting is not received - @raise QMPCapabilitiesError if fails to negotiate capabilities - - [1] - https://docs.python.org/3/library/socket.html#socket.socket.settim= eout - """ - self.__sock.settimeout(timeout) - self.__sock, _ =3D self.__sock.accept() - self.__sockfile =3D self.__sock.makefile(mode=3D'r') - return self.__negotiate_capabilities() - - def cmd_obj(self, qmp_cmd: QMPMessage) -> QMPMessage: - """ - Send a QMP command to the QMP Monitor. - - @param qmp_cmd: QMP command to be sent as a Python dict - @return QMP response as a Python dict - """ - self.logger.debug(">>> %s", qmp_cmd) - self.__sock.sendall(json.dumps(qmp_cmd).encode('utf-8')) - resp =3D self.__json_read() - if resp is None: - raise QMPConnectError("Unexpected empty reply from server") - self.logger.debug("<<< %s", resp) - return resp - - def cmd(self, name: str, - args: Optional[Dict[str, object]] =3D None, - cmd_id: Optional[object] =3D None) -> QMPMessage: - """ - Build a QMP command and send it to the QMP Monitor. - - @param name: command name (string) - @param args: command arguments (dict) - @param cmd_id: command id (dict, list, string or int) - """ - qmp_cmd: QMPMessage =3D {'execute': name} - if args: - qmp_cmd['arguments'] =3D args - if cmd_id: - qmp_cmd['id'] =3D cmd_id - return self.cmd_obj(qmp_cmd) - - def command(self, cmd: str, **kwds: object) -> QMPReturnValue: - """ - Build and send a QMP command to the monitor, report errors if any - """ - ret =3D self.cmd(cmd, kwds) - if 'error' in ret: - raise QMPResponseError(ret) - if 'return' not in ret: - raise QMPProtocolError( - "'return' key not found in QMP response '{}'".format(str(r= et)) - ) - return cast(QMPReturnValue, ret['return']) - - def pull_event(self, - wait: Union[bool, float] =3D False) -> Optional[QMPMess= age]: - """ - Pulls a single event. - - @param wait (bool): block until an event is available. - @param wait (float): If wait is a float, treat it as a timeout val= ue. - - @raise QMPTimeoutError: If a timeout float is provided and the tim= eout - period elapses. - @raise QMPConnectError: If wait is True but no events could be - retrieved or if some other error occurred. - - @return The first available QMP event, or None. - """ - self.__get_events(wait) - - if self.__events: - return self.__events.pop(0) - return None - - def get_events(self, wait: bool =3D False) -> List[QMPMessage]: - """ - Get a list of available QMP events and clear all pending events. - - @param wait (bool): block until an event is available. - @param wait (float): If wait is a float, treat it as a timeout val= ue. - - @raise QMPTimeoutError: If a timeout float is provided and the tim= eout - period elapses. - @raise QMPConnectError: If wait is True but no events could be - retrieved or if some other error occurred. - - @return The list of available QMP events. - """ - self.__get_events(wait) - events =3D self.__events - self.__events =3D [] - return events - - def clear_events(self) -> None: - """ - Clear current list of pending events. - """ - self.__events =3D [] - - def close(self) -> None: - """ - Close the socket and socket file. - """ - if self.__sock: - self.__sock.close() - if self.__sockfile: - self.__sockfile.close() - - def settimeout(self, timeout: Optional[float]) -> None: - """ - Set the socket timeout. - - @param timeout (float): timeout in seconds (non-zero), or None. - @note This is a wrap around socket.settimeout - - @raise ValueError: if timeout was set to 0. - """ - if timeout =3D=3D 0: - msg =3D "timeout cannot be 0; this engages non-blocking mode." - msg +=3D " Use 'None' instead to disable timeouts." - raise ValueError(msg) - self.__sock.settimeout(timeout) - - def send_fd_scm(self, fd: int) -> None: - """ - Send a file descriptor to the remote via SCM_RIGHTS. - """ - if self.__sock.family !=3D socket.AF_UNIX: - raise RuntimeError("Can't use SCM_RIGHTS on non-AF_UNIX socket= .") - - self.__sock.sendmsg( - [b' '], - [(socket.SOL_SOCKET, socket.SCM_RIGHTS, struct.pack('@i', fd))] - ) diff --git a/python/qemu/qmp/py.typed b/python/qemu/qmp/py.typed deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/python/setup.cfg b/python/setup.cfg index cdeced44d2b..4340c29a24f 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -24,10 +24,9 @@ classifiers =3D [options] python_requires =3D >=3D 3.6 packages =3D - qemu.qmp + qemu.aqmp qemu.machine qemu.utils - qemu.aqmp =20 [options.package_data] * =3D py.typed --=20 2.34.1 From nobody Tue May 21 19:50:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650554586376874.2431921025761; Thu, 21 Apr 2022 08:23:06 -0700 (PDT) Received: from localhost ([::1]:53042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYe9-0005ZW-DV for importer@patchew.org; Thu, 21 Apr 2022 11:23:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXZ-0003Z2-5B for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXT-0005o1-Vu for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:16 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-296-LbYJGPZ3ObWahja24KJa5Q-1; Thu, 21 Apr 2022 11:16:09 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 25AAB1E15C08; Thu, 21 Apr 2022 15:16:09 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD34C40D016A; Thu, 21 Apr 2022 15:16:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554170; 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=Hldfh28tlH/XNVOtvQPvrG5Hg2x0dum+exiRK5DEFEk=; b=LKZcZ+SCYW8T0TCta4hyTi+i8csONJcqOwnHjnFWsU7XrKPoZp5MH6k/W+XE3lF41ygCKS Q+XdW1TPkr21Srb4U/+7tGujxU7b+XdiCa158YiB1HTY/1eKZE8LF6IXy0jn/j7J/udGBE mDPSdT9g7VSq6e/1qlIbLxcMI2ePIH8= X-MC-Unique: LbYJGPZ3ObWahja24KJa5Q-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 14/17] python: re-enable pylint duplicate-code warnings Date: Thu, 21 Apr 2022 11:15:57 -0400 Message-Id: <20220421151600.984189-15-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650554588197100001 Content-Type: text/plain; charset="utf-8" With the old library gone, there's nothing duplicated in the tree, so the warning suppression can be removed. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Message-id: 20220330172812.3427355-7-jsnow@redhat.com Signed-off-by: John Snow --- python/setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/python/setup.cfg b/python/setup.cfg index 4340c29a24f..49e3c285f19 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -118,7 +118,6 @@ disable=3Dconsider-using-f-string, too-many-function-args, # mypy handles this with less false posit= ives. too-many-instance-attributes, no-member, # mypy also handles this better. - duplicate-code, # To be removed by the end of this patch series. =20 [pylint.basic] # Good variable names which should always be accepted, separated by a comm= a. --=20 2.34.1 From nobody Tue May 21 19:50:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650555655679429.4875516527768; Thu, 21 Apr 2022 08:40:55 -0700 (PDT) Received: from localhost ([::1]:43942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYvO-0008AO-Co for importer@patchew.org; Thu, 21 Apr 2022 11:40:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXf-0003tU-4E for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:49025) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXX-0005ps-2J for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:22 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-527-FzNFQMJ2Mb2z6BbuiYbzgw-1; Thu, 21 Apr 2022 11:16:10 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B67681E15C05; Thu, 21 Apr 2022 15:16:09 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32D4940D016A; Thu, 21 Apr 2022 15:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554174; 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=RPK30BpE9eYbb+HSe4qCY2Ru3K7Ql+SVgBjxhuheg7I=; b=clKXPgtHHyFzufoJGgJ+fwfbgtFM3KNuH1nWeT8zXPNw6f2OrEJkaftRRmFtXoq+ufszlp GCK/KK1f35Td7TYN91Dhw/i6uzo9MIYHEggunKTwFIFwWjFq6MNNbJ5JZqujGElyVcWUMs 5+XlMPcxvf9SJox8YzI/jJZpPQeKuOY= X-MC-Unique: FzNFQMJ2Mb2z6BbuiYbzgw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 15/17] python: rename qemu.aqmp to qemu.qmp Date: Thu, 21 Apr 2022 11:15:58 -0400 Message-Id: <20220421151600.984189-16-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650555657325100001 Content-Type: text/plain; charset="utf-8" Now that we are fully switched over to the new QMP library, move it back over the old namespace. This is being done primarily so that we may upload this package simply as "qemu.qmp" without introducing confusion over whether or not "aqmp" is a new protocol or not. The trade-off is increased confusion inside the QEMU developer tree. Sorry! Note: the 'private' member "_aqmp" in legacy.py also changes to "_qmp"; not out of necessity, but just to remove any traces of the "aqmp" name. Signed-off-by: John Snow Reviewed-by: Beraldo Leal Acked-by: Hanna Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20220330172812.3427355-8-jsnow@redhat.com Signed-off-by: John Snow --- python/PACKAGE.rst | 4 +-- python/README.rst | 4 +-- python/qemu/machine/machine.py | 4 +-- python/qemu/machine/qtest.py | 2 +- python/qemu/{aqmp =3D> qmp}/__init__.py | 6 ++-- python/qemu/{aqmp =3D> qmp}/aqmp_tui.py | 0 python/qemu/{aqmp =3D> qmp}/error.py | 0 python/qemu/{aqmp =3D> qmp}/events.py | 2 +- python/qemu/{aqmp =3D> qmp}/legacy.py | 38 +++++++++++------------ python/qemu/{aqmp =3D> qmp}/message.py | 0 python/qemu/{aqmp =3D> qmp}/models.py | 0 python/qemu/{aqmp =3D> qmp}/protocol.py | 4 +-- python/qemu/{aqmp =3D> qmp}/py.typed | 0 python/qemu/{aqmp =3D> qmp}/qmp_client.py | 16 +++++----- python/qemu/{aqmp =3D> qmp}/qmp_shell.py | 4 +-- python/qemu/{aqmp =3D> qmp}/util.py | 0 python/qemu/utils/qemu_ga_client.py | 4 +-- python/qemu/utils/qom.py | 2 +- python/qemu/utils/qom_common.py | 4 +-- python/qemu/utils/qom_fuse.py | 2 +- python/setup.cfg | 10 +++--- python/tests/protocol.py | 14 ++++----- scripts/cpu-x86-uarch-abi.py | 2 +- scripts/device-crash-test | 4 +-- scripts/qmp/qmp-shell | 2 +- scripts/qmp/qmp-shell-wrap | 2 +- scripts/render_block_graph.py | 4 +-- scripts/simplebench/bench_block_job.py | 2 +- tests/qemu-iotests/iotests.py | 2 +- tests/qemu-iotests/tests/mirror-top-perms | 4 +-- 30 files changed, 71 insertions(+), 71 deletions(-) rename python/qemu/{aqmp =3D> qmp}/__init__.py (87%) rename python/qemu/{aqmp =3D> qmp}/aqmp_tui.py (100%) rename python/qemu/{aqmp =3D> qmp}/error.py (100%) rename python/qemu/{aqmp =3D> qmp}/events.py (99%) rename python/qemu/{aqmp =3D> qmp}/legacy.py (91%) rename python/qemu/{aqmp =3D> qmp}/message.py (100%) rename python/qemu/{aqmp =3D> qmp}/models.py (100%) rename python/qemu/{aqmp =3D> qmp}/protocol.py (99%) rename python/qemu/{aqmp =3D> qmp}/py.typed (100%) rename python/qemu/{aqmp =3D> qmp}/qmp_client.py (97%) rename python/qemu/{aqmp =3D> qmp}/qmp_shell.py (99%) rename python/qemu/{aqmp =3D> qmp}/util.py (100%) diff --git a/python/PACKAGE.rst b/python/PACKAGE.rst index ddfa9ba3f59..b0b86cc4c31 100644 --- a/python/PACKAGE.rst +++ b/python/PACKAGE.rst @@ -8,11 +8,11 @@ to change at any time. Usage ----- =20 -The ``qemu.aqmp`` subpackage provides a library for communicating with +The ``qemu.qmp`` subpackage provides a library for communicating with QMP servers. The ``qemu.machine`` subpackage offers rudimentary facilities for launching and managing QEMU processes. Refer to each package's documentation -(``>>> help(qemu.aqmp)``, ``>>> help(qemu.machine)``) +(``>>> help(qemu.qmp)``, ``>>> help(qemu.machine)``) for more information. =20 Contributing diff --git a/python/README.rst b/python/README.rst index eb5213337d2..9c1fceaee73 100644 --- a/python/README.rst +++ b/python/README.rst @@ -3,7 +3,7 @@ QEMU Python Tooling =20 This directory houses Python tooling used by the QEMU project to build, configure, and test QEMU. It is organized by namespace (``qemu``), and -then by package (e.g. ``qemu/machine``, ``qemu/aqmp``, etc). +then by package (e.g. ``qemu/machine``, ``qemu/qmp``, etc). =20 ``setup.py`` is used by ``pip`` to install this tooling to the current environment. ``setup.cfg`` provides the packaging configuration used by @@ -59,7 +59,7 @@ Package installation also normally provides executable co= nsole scripts, so that tools like ``qmp-shell`` are always available via $PATH. To invoke them without installation, you can invoke e.g.: =20 -``> PYTHONPATH=3D~/src/qemu/python python3 -m qemu.aqmp.qmp_shell`` +``> PYTHONPATH=3D~/src/qemu/python python3 -m qemu.qmp.qmp_shell`` =20 The mappings between console script name and python module path can be found in ``setup.cfg``. diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 41be025ac7b..07ac5a710be 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -40,8 +40,8 @@ TypeVar, ) =20 -from qemu.aqmp import SocketAddrT -from qemu.aqmp.legacy import ( +from qemu.qmp import SocketAddrT +from qemu.qmp.legacy import ( QEMUMonitorProtocol, QMPMessage, QMPReturnValue, diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py index 13e0aaff846..1a1fc6c9b08 100644 --- a/python/qemu/machine/qtest.py +++ b/python/qemu/machine/qtest.py @@ -26,7 +26,7 @@ TextIO, ) =20 -from qemu.aqmp import SocketAddrT +from qemu.qmp import SocketAddrT =20 from .machine import QEMUMachine =20 diff --git a/python/qemu/aqmp/__init__.py b/python/qemu/qmp/__init__.py similarity index 87% rename from python/qemu/aqmp/__init__.py rename to python/qemu/qmp/__init__.py index 2b69b264f4f..69190d057a5 100644 --- a/python/qemu/aqmp/__init__.py +++ b/python/qemu/qmp/__init__.py @@ -6,8 +6,8 @@ QEMU Guest Agent, and the QEMU Storage Daemon. =20 `QMPClient` provides the main functionality of this package. All errors -raised by this library derive from `QMPError`, see `aqmp.error` for -additional detail. See `aqmp.events` for an in-depth tutorial on +raised by this library derive from `QMPError`, see `qmp.error` for +additional detail. See `qmp.events` for an in-depth tutorial on managing QMP events. """ =20 @@ -36,7 +36,7 @@ =20 =20 # Suppress logging unless an application engages it. -logging.getLogger('qemu.aqmp').addHandler(logging.NullHandler()) +logging.getLogger('qemu.qmp').addHandler(logging.NullHandler()) =20 =20 # The order of these fields impact the Sphinx documentation order. diff --git a/python/qemu/aqmp/aqmp_tui.py b/python/qemu/qmp/aqmp_tui.py similarity index 100% rename from python/qemu/aqmp/aqmp_tui.py rename to python/qemu/qmp/aqmp_tui.py diff --git a/python/qemu/aqmp/error.py b/python/qemu/qmp/error.py similarity index 100% rename from python/qemu/aqmp/error.py rename to python/qemu/qmp/error.py diff --git a/python/qemu/aqmp/events.py b/python/qemu/qmp/events.py similarity index 99% rename from python/qemu/aqmp/events.py rename to python/qemu/qmp/events.py index f3d4e2b5e85..6199776cc66 100644 --- a/python/qemu/aqmp/events.py +++ b/python/qemu/qmp/events.py @@ -1,5 +1,5 @@ """ -AQMP Events and EventListeners +QMP Events and EventListeners =20 Asynchronous QMP uses `EventListener` objects to listen for events. An `EventListener` is a FIFO event queue that can be pre-filtered to listen diff --git a/python/qemu/aqmp/legacy.py b/python/qemu/qmp/legacy.py similarity index 91% rename from python/qemu/aqmp/legacy.py rename to python/qemu/qmp/legacy.py index dfcd20bbd23..a8629b44dff 100644 --- a/python/qemu/aqmp/legacy.py +++ b/python/qemu/qmp/legacy.py @@ -78,13 +78,13 @@ def __init__(self, address: SocketAddrT, server: bool =3D False, nickname: Optional[str] =3D None): =20 - self._aqmp =3D QMPClient(nickname) + self._qmp =3D QMPClient(nickname) self._aloop =3D asyncio.get_event_loop() self._address =3D address self._timeout: Optional[float] =3D None =20 if server: - self._sync(self._aqmp.start_server(self._address)) + self._sync(self._qmp.start_server(self._address)) =20 _T =3D TypeVar('_T') =20 @@ -96,9 +96,9 @@ def _sync( ) =20 def _get_greeting(self) -> Optional[QMPMessage]: - if self._aqmp.greeting is not None: + if self._qmp.greeting is not None: # pylint: disable=3Dprotected-access - return self._aqmp.greeting._asdict() + return self._qmp.greeting._asdict() return None =20 def __enter__(self: _T) -> _T: @@ -141,11 +141,11 @@ def connect(self, negotiate: bool =3D True) -> Option= al[QMPMessage]: :return: QMP greeting dict, or None if negotiate is false :raise ConnectError: on connection errors """ - self._aqmp.await_greeting =3D negotiate - self._aqmp.negotiate =3D negotiate + self._qmp.await_greeting =3D negotiate + self._qmp.negotiate =3D negotiate =20 self._sync( - self._aqmp.connect(self._address) + self._qmp.connect(self._address) ) return self._get_greeting() =20 @@ -160,10 +160,10 @@ def accept(self, timeout: Optional[float] =3D 15.0) -= > QMPMessage: :return: QMP greeting dict :raise ConnectError: on connection errors """ - self._aqmp.await_greeting =3D True - self._aqmp.negotiate =3D True + self._qmp.await_greeting =3D True + self._qmp.negotiate =3D True =20 - self._sync(self._aqmp.accept(), timeout) + self._sync(self._qmp.accept(), timeout) =20 ret =3D self._get_greeting() assert ret is not None @@ -183,7 +183,7 @@ def cmd_obj(self, qmp_cmd: QMPMessage) -> QMPMessage: # _raw() isn't a public API, because turning off # automatic ID assignment is discouraged. For # compatibility with iotests *only*, do it anyway. - self._aqmp._raw(qmp_cmd, assign_id=3DFalse), + self._qmp._raw(qmp_cmd, assign_id=3DFalse), self._timeout ) ) @@ -210,7 +210,7 @@ def command(self, cmd: str, **kwds: object) -> QMPRetur= nValue: Build and send a QMP command to the monitor, report errors if any """ return self._sync( - self._aqmp.execute(cmd, kwds), + self._qmp.execute(cmd, kwds), self._timeout ) =20 @@ -231,7 +231,7 @@ def pull_event(self, """ if not wait: # wait is False/0: "do not wait, do not except." - if self._aqmp.events.empty(): + if self._qmp.events.empty(): return None =20 # If wait is 'True', wait forever. If wait is False/0, the events @@ -243,7 +243,7 @@ def pull_event(self, =20 return dict( self._sync( - self._aqmp.events.get(), + self._qmp.events.get(), timeout ) ) @@ -263,7 +263,7 @@ def get_events(self, wait: Union[bool, float] =3D False= ) -> List[QMPMessage]: =20 :return: A list of QMP events. """ - events =3D [dict(x) for x in self._aqmp.events.clear()] + events =3D [dict(x) for x in self._qmp.events.clear()] if events: return events =20 @@ -272,12 +272,12 @@ def get_events(self, wait: Union[bool, float] =3D Fal= se) -> List[QMPMessage]: =20 def clear_events(self) -> None: """Clear current list of pending events.""" - self._aqmp.events.clear() + self._qmp.events.clear() =20 def close(self) -> None: """Close the connection.""" self._sync( - self._aqmp.disconnect() + self._qmp.disconnect() ) =20 def settimeout(self, timeout: Optional[float]) -> None: @@ -298,10 +298,10 @@ def send_fd_scm(self, fd: int) -> None: """ Send a file descriptor to the remote via SCM_RIGHTS. """ - self._aqmp.send_fd_scm(fd) + self._qmp.send_fd_scm(fd) =20 def __del__(self) -> None: - if self._aqmp.runstate =3D=3D Runstate.IDLE: + if self._qmp.runstate =3D=3D Runstate.IDLE: return =20 if not self._aloop.is_running(): diff --git a/python/qemu/aqmp/message.py b/python/qemu/qmp/message.py similarity index 100% rename from python/qemu/aqmp/message.py rename to python/qemu/qmp/message.py diff --git a/python/qemu/aqmp/models.py b/python/qemu/qmp/models.py similarity index 100% rename from python/qemu/aqmp/models.py rename to python/qemu/qmp/models.py diff --git a/python/qemu/aqmp/protocol.py b/python/qemu/qmp/protocol.py similarity index 99% rename from python/qemu/aqmp/protocol.py rename to python/qemu/qmp/protocol.py index 36fae57f277..6ea86650ad2 100644 --- a/python/qemu/aqmp/protocol.py +++ b/python/qemu/qmp/protocol.py @@ -196,9 +196,9 @@ class AsyncProtocol(Generic[T]): =20 :param name: Name used for logging messages, if any. By default, messages - will log to 'qemu.aqmp.protocol', but each individual connection + will log to 'qemu.qmp.protocol', but each individual connection can be given its own logger by giving it a name; messages will - then log to 'qemu.aqmp.protocol.${name}'. + then log to 'qemu.qmp.protocol.${name}'. """ # pylint: disable=3Dtoo-many-instance-attributes =20 diff --git a/python/qemu/aqmp/py.typed b/python/qemu/qmp/py.typed similarity index 100% rename from python/qemu/aqmp/py.typed rename to python/qemu/qmp/py.typed diff --git a/python/qemu/aqmp/qmp_client.py b/python/qemu/qmp/qmp_client.py similarity index 97% rename from python/qemu/aqmp/qmp_client.py rename to python/qemu/qmp/qmp_client.py index 90a8737f03a..5dcda04a756 100644 --- a/python/qemu/aqmp/qmp_client.py +++ b/python/qemu/qmp/qmp_client.py @@ -192,7 +192,7 @@ async def run(self, address=3D'/tmp/qemu.socket'): await self.qmp.runstate_changed.wait() await self.disconnect() =20 - See `aqmp.events` for more detail on event handling patterns. + See `qmp.events` for more detail on event handling patterns. """ #: Logger object used for debugging messages. logger =3D logging.getLogger(__name__) @@ -416,7 +416,7 @@ def _do_send(self, msg: Message) -> None: =20 @upper_half def _get_exec_id(self) -> str: - exec_id =3D f"__aqmp#{self._execute_id:05d}" + exec_id =3D f"__qmp#{self._execute_id:05d}" self._execute_id +=3D 1 return exec_id =20 @@ -476,7 +476,7 @@ async def _execute(self, msg: Message, assign_id: bool = =3D True) -> Message: An execution ID will be assigned if assign_id is `True`. It can be disabled, but this requires that an ID is manually assigned instead. For manually assigned IDs, you must not use the string - '__aqmp#' anywhere in the ID. + '__qmp#' anywhere in the ID. =20 :param msg: The QMP `Message` to execute. :param assign_id: If True, assign a new execution ID. @@ -490,7 +490,7 @@ async def _execute(self, msg: Message, assign_id: bool = =3D True) -> Message: msg['id'] =3D self._get_exec_id() elif 'id' in msg: assert isinstance(msg['id'], str) - assert '__aqmp#' not in msg['id'] + assert '__qmp#' not in msg['id'] =20 exec_id =3D await self._issue(msg) return await self._reply(exec_id) @@ -512,7 +512,7 @@ async def _raw( Assign an arbitrary execution ID to this message. If `False`, the existing id must either be absent (and no other such pending execution may omit an ID) or a string. If it is - a string, it must not start with '__aqmp#' and no other such + a string, it must not start with '__qmp#' and no other such pending execution may currently be using that ID. =20 :return: Execution reply from the server. @@ -524,7 +524,7 @@ async def _raw( When assign_id is `False`, an ID is given, and it is not a str= ing. :raise ValueError: When assign_id is `False`, but the ID is not usable; - Either because it starts with '__aqmp#' or it is already in-us= e. + Either because it starts with '__qmp#' or it is already in-use. """ # 1. convert generic Mapping or bytes to a QMP Message # 2. copy Message objects so that we assign an ID only to the copy. @@ -534,9 +534,9 @@ async def _raw( if not assign_id and 'id' in msg: if not isinstance(exec_id, str): raise TypeError(f"ID ('{exec_id}') must be a string.") - if exec_id.startswith('__aqmp#'): + if exec_id.startswith('__qmp#'): raise ValueError( - f"ID ('{exec_id}') must not start with '__aqmp#'." + f"ID ('{exec_id}') must not start with '__qmp#'." ) =20 if not assign_id and exec_id in self._pending: diff --git a/python/qemu/aqmp/qmp_shell.py b/python/qemu/qmp/qmp_shell.py similarity index 99% rename from python/qemu/aqmp/qmp_shell.py rename to python/qemu/qmp/qmp_shell.py index c23f1b19280..619ab42cedd 100644 --- a/python/qemu/aqmp/qmp_shell.py +++ b/python/qemu/qmp/qmp_shell.py @@ -98,8 +98,8 @@ Sequence, ) =20 -from qemu.aqmp import ConnectError, QMPError, SocketAddrT -from qemu.aqmp.legacy import ( +from qemu.qmp import ConnectError, QMPError, SocketAddrT +from qemu.qmp.legacy import ( QEMUMonitorProtocol, QMPBadPortError, QMPMessage, diff --git a/python/qemu/aqmp/util.py b/python/qemu/qmp/util.py similarity index 100% rename from python/qemu/aqmp/util.py rename to python/qemu/qmp/util.py diff --git a/python/qemu/utils/qemu_ga_client.py b/python/qemu/utils/qemu_g= a_client.py index 15ed430c618..8c38a7ac9c0 100644 --- a/python/qemu/utils/qemu_ga_client.py +++ b/python/qemu/utils/qemu_ga_client.py @@ -50,8 +50,8 @@ Sequence, ) =20 -from qemu.aqmp import ConnectError, SocketAddrT -from qemu.aqmp.legacy import QEMUMonitorProtocol +from qemu.qmp import ConnectError, SocketAddrT +from qemu.qmp.legacy import QEMUMonitorProtocol =20 =20 # This script has not seen many patches or careful attention in quite diff --git a/python/qemu/utils/qom.py b/python/qemu/utils/qom.py index bb5d1a78f59..bcf192f4774 100644 --- a/python/qemu/utils/qom.py +++ b/python/qemu/utils/qom.py @@ -32,7 +32,7 @@ =20 import argparse =20 -from qemu.aqmp import ExecuteError +from qemu.qmp import ExecuteError =20 from .qom_common import QOMCommand =20 diff --git a/python/qemu/utils/qom_common.py b/python/qemu/utils/qom_common= .py index e034a6f2476..80da1b23041 100644 --- a/python/qemu/utils/qom_common.py +++ b/python/qemu/utils/qom_common.py @@ -27,8 +27,8 @@ TypeVar, ) =20 -from qemu.aqmp import QMPError -from qemu.aqmp.legacy import QEMUMonitorProtocol +from qemu.qmp import QMPError +from qemu.qmp.legacy import QEMUMonitorProtocol =20 =20 class ObjectPropertyInfo: diff --git a/python/qemu/utils/qom_fuse.py b/python/qemu/utils/qom_fuse.py index 653a76b93b9..8dcd59fcde6 100644 --- a/python/qemu/utils/qom_fuse.py +++ b/python/qemu/utils/qom_fuse.py @@ -48,7 +48,7 @@ import fuse from fuse import FUSE, FuseOSError, Operations =20 -from qemu.aqmp import ExecuteError +from qemu.qmp import ExecuteError =20 from .qom_common import QOMCommand =20 diff --git a/python/setup.cfg b/python/setup.cfg index 49e3c285f19..773e51b34e7 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -24,7 +24,7 @@ classifiers =3D [options] python_requires =3D >=3D 3.6 packages =3D - qemu.aqmp + qemu.qmp qemu.machine qemu.utils =20 @@ -66,9 +66,9 @@ console_scripts =3D qom-tree =3D qemu.utils.qom:QOMTree.entry_point qom-fuse =3D qemu.utils.qom_fuse:QOMFuse.entry_point [fuse] qemu-ga-client =3D qemu.utils.qemu_ga_client:main - qmp-shell =3D qemu.aqmp.qmp_shell:main - qmp-shell-wrap =3D qemu.aqmp.qmp_shell:main_wrap - aqmp-tui =3D qemu.aqmp.aqmp_tui:main [tui] + qmp-shell =3D qemu.qmp.qmp_shell:main + qmp-shell-wrap =3D qemu.qmp.qmp_shell:main_wrap + aqmp-tui =3D qemu.qmp.aqmp_tui:main [tui] =20 [flake8] extend-ignore =3D E722 # Prefer pylint's bare-except checks to flake8's @@ -84,7 +84,7 @@ namespace_packages =3D True # fusepy has no type stubs: allow_subclassing_any =3D True =20 -[mypy-qemu.aqmp.aqmp_tui] +[mypy-qemu.qmp.aqmp_tui] # urwid and urwid_readline have no type stubs: allow_subclassing_any =3D True =20 diff --git a/python/tests/protocol.py b/python/tests/protocol.py index d6849ad3062..56c4d441f9c 100644 --- a/python/tests/protocol.py +++ b/python/tests/protocol.py @@ -6,9 +6,9 @@ =20 import avocado =20 -from qemu.aqmp import ConnectError, Runstate -from qemu.aqmp.protocol import AsyncProtocol, StateError -from qemu.aqmp.util import asyncio_run, create_task +from qemu.qmp import ConnectError, Runstate +from qemu.qmp.protocol import AsyncProtocol, StateError +from qemu.qmp.util import asyncio_run, create_task =20 =20 class NullProtocol(AsyncProtocol[None]): @@ -183,7 +183,7 @@ def testDefaultName(self): def testLogger(self): self.assertEqual( self.proto.logger.name, - 'qemu.aqmp.protocol' + 'qemu.qmp.protocol' ) =20 def testName(self): @@ -196,7 +196,7 @@ def testName(self): =20 self.assertEqual( self.proto.logger.name, - 'qemu.aqmp.protocol.Steve' + 'qemu.qmp.protocol.Steve' ) =20 self.assertEqual( @@ -431,7 +431,7 @@ async def _bad_connection(self, family: str): await self.proto.start_server_and_accept('/dev/null') =20 async def _hanging_connection(self): - with TemporaryDirectory(suffix=3D'.aqmp') as tmpdir: + with TemporaryDirectory(suffix=3D'.qmp') as tmpdir: sock =3D os.path.join(tmpdir, type(self.proto).__name__ + ".so= ck") await self.proto.start_server_and_accept(sock) =20 @@ -587,7 +587,7 @@ async def _asyncTearDown(self): =20 @TestBase.async_test async def testSmoke(self): - with TemporaryDirectory(suffix=3D'.aqmp') as tmpdir: + 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)) =20 diff --git a/scripts/cpu-x86-uarch-abi.py b/scripts/cpu-x86-uarch-abi.py index c262d2f0277..82ff07582f8 100644 --- a/scripts/cpu-x86-uarch-abi.py +++ b/scripts/cpu-x86-uarch-abi.py @@ -6,7 +6,7 @@ # compatibility levels for each CPU model. # =20 -from qemu.aqmp.legacy import QEMUMonitorProtocol +from qemu.qmp.legacy import QEMUMonitorProtocol import sys =20 if len(sys.argv) !=3D 2: diff --git a/scripts/device-crash-test b/scripts/device-crash-test index 7fbd99158be..4bfc68c0087 100755 --- a/scripts/device-crash-test +++ b/scripts/device-crash-test @@ -36,7 +36,7 @@ from itertools import chain =20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python')) from qemu.machine import QEMUMachine -from qemu.aqmp import ConnectError +from qemu.qmp import ConnectError =20 logger =3D logging.getLogger('device-crash-test') dbg =3D logger.debug @@ -517,7 +517,7 @@ def main(): # Async QMP, when in use, is chatty about connection failures. # This script knowingly generates a ton of connection errors. # Silence this logger. - logging.getLogger('qemu.aqmp.qmp_client').setLevel(logging.CRITICA= L) + logging.getLogger('qemu.qmp.qmp_client').setLevel(logging.CRITICAL) =20 fatal_failures =3D [] wl_stats =3D {} diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index 31b19d73e22..4a20f97db70 100755 --- a/scripts/qmp/qmp-shell +++ b/scripts/qmp/qmp-shell @@ -4,7 +4,7 @@ import os import sys =20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.aqmp import qmp_shell +from qemu.qmp import qmp_shell =20 =20 if __name__ =3D=3D '__main__': diff --git a/scripts/qmp/qmp-shell-wrap b/scripts/qmp/qmp-shell-wrap index 66846e36d1f..9e94da114f5 100755 --- a/scripts/qmp/qmp-shell-wrap +++ b/scripts/qmp/qmp-shell-wrap @@ -4,7 +4,7 @@ import os import sys =20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.aqmp import qmp_shell +from qemu.qmp import qmp_shell =20 =20 if __name__ =3D=3D '__main__': diff --git a/scripts/render_block_graph.py b/scripts/render_block_graph.py index b33fb70d5ee..8f731a5cfe1 100755 --- a/scripts/render_block_graph.py +++ b/scripts/render_block_graph.py @@ -25,8 +25,8 @@ from graphviz import Digraph =20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python')) -from qemu.aqmp import QMPError -from qemu.aqmp.legacy import QEMUMonitorProtocol +from qemu.qmp import QMPError +from qemu.qmp.legacy import QEMUMonitorProtocol =20 =20 def perm(arr): diff --git a/scripts/simplebench/bench_block_job.py b/scripts/simplebench/b= ench_block_job.py index af9d1646a46..56191db44b2 100755 --- a/scripts/simplebench/bench_block_job.py +++ b/scripts/simplebench/bench_block_job.py @@ -27,7 +27,7 @@ =20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) from qemu.machine import QEMUMachine -from qemu.aqmp import ConnectError +from qemu.qmp import ConnectError =20 =20 def bench_block_job(cmd, cmd_args, qemu_args): diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 6f9aa38e0e8..33a44671aa8 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -37,8 +37,8 @@ =20 from contextlib import contextmanager =20 -from qemu.aqmp.legacy import QMPMessage, QEMUMonitorProtocol from qemu.machine import qtest +from qemu.qmp.legacy import QMPMessage, QEMUMonitorProtocol from qemu.utils import VerboseProcessError =20 # Use this logger for logging messages directly from the iotests module diff --git a/tests/qemu-iotests/tests/mirror-top-perms b/tests/qemu-iotests= /tests/mirror-top-perms index a9f275cd7f2..8bca5927089 100755 --- a/tests/qemu-iotests/tests/mirror-top-perms +++ b/tests/qemu-iotests/tests/mirror-top-perms @@ -97,8 +97,8 @@ class TestMirrorTopPerms(iotests.QMPTestCase): self.vm_b.add_blockdev(f'file,node-name=3Ddrive0,filename=3D{sourc= e}') self.vm_b.add_device('virtio-blk,drive=3Ddrive0,share-rw=3Don') try: - # Silence AQMP logging errors temporarily. - with change_log_level('qemu.aqmp'): + # Silence QMP logging errors temporarily. + with change_log_level('qemu.qmp'): self.vm_b.launch() print('ERROR: VM B launched successfully, ' 'this should not have happened') --=20 2.34.1 From nobody Tue May 21 19:50:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165055543479759.70088166718858; Thu, 21 Apr 2022 08:37:14 -0700 (PDT) Received: from localhost ([::1]:35050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYro-0000xQ-FA for importer@patchew.org; Thu, 21 Apr 2022 11:37:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXd-0003pZ-KG for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXX-0005pb-1e for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:21 -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-634-6Dz-frO9NRW-wXjodwOi5A-1; Thu, 21 Apr 2022 11:16:10 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3F8FD833962; Thu, 21 Apr 2022 15:16:10 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id C489540D016E; Thu, 21 Apr 2022 15:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554174; 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=5JxRgB0j/XCdh82vR5ZUBYo4yIexFax9ZfGqUuGH5Uw=; b=B6DSSwNE2jUnCwuwGLyqQ0swYfOdJXvzd29PBZSUZgePNxqo1iqOqsyCei1AGn43j0O0e6 IbxGIbJQ2lgIfF2gSQJIGY6oMk6dxtmBmrzXLEBX058PfjfP7+BTSYmZkD8ohhgCgNi57y h1RJilZuIHSpKR4XR+VQE7+enz/03xQ= X-MC-Unique: 6Dz-frO9NRW-wXjodwOi5A-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 16/17] python: rename 'aqmp-tui' to 'qmp-tui' Date: Thu, 21 Apr 2022 11:15:59 -0400 Message-Id: <20220421151600.984189-17-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650555436195100001 Content-Type: text/plain; charset="utf-8" This is the last vestige of the "aqmp" moniker surviving in the tree; remov= e it. Signed-off-by: John Snow Reviewed-by: Beraldo Leal Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20220330172812.3427355-9-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/qmp/{aqmp_tui.py =3D> qmp_tui.py} | 12 ++++++------ python/setup.cfg | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) rename python/qemu/qmp/{aqmp_tui.py =3D> qmp_tui.py} (98%) diff --git a/python/qemu/qmp/aqmp_tui.py b/python/qemu/qmp/qmp_tui.py similarity index 98% rename from python/qemu/qmp/aqmp_tui.py rename to python/qemu/qmp/qmp_tui.py index 59d3036be38..ce239d8979b 100644 --- a/python/qemu/qmp/aqmp_tui.py +++ b/python/qemu/qmp/qmp_tui.py @@ -6,13 +6,13 @@ # This work is licensed under the terms of the GNU LGPL, version 2 or # later. See the COPYING file in the top-level directory. """ -AQMP TUI +QMP TUI =20 -AQMP TUI is an asynchronous interface built on top the of the AQMP library. +QMP TUI is an asynchronous interface built on top the of the QMP library. It is the successor of QMP-shell and is bought-in as a replacement for it. =20 -Example Usage: aqmp-tui -Full Usage: aqmp-tui --help +Example Usage: qmp-tui +Full Usage: qmp-tui --help """ =20 import argparse @@ -129,7 +129,7 @@ def has_handler_type(logger: logging.Logger, =20 class App(QMPClient): """ - Implements the AQMP TUI. + Implements the QMP TUI. =20 Initializes the widgets and starts the urwid event loop. =20 @@ -612,7 +612,7 @@ def main() -> None: Driver of the whole script, parses arguments, initialize the TUI and the logger. """ - parser =3D argparse.ArgumentParser(description=3D'AQMP TUI') + parser =3D argparse.ArgumentParser(description=3D'QMP TUI') parser.add_argument('qmp_server', help=3D'Address of the QMP server. ' 'Format ') parser.add_argument('--num-retries', type=3Dint, default=3D10, diff --git a/python/setup.cfg b/python/setup.cfg index 773e51b34e7..e877ea56475 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -51,7 +51,7 @@ devel =3D fuse =3D fusepy >=3D 2.0.4 =20 -# AQMP TUI dependencies +# QMP TUI dependencies tui =3D urwid >=3D 2.1.2 urwid-readline >=3D 0.13 @@ -68,7 +68,7 @@ console_scripts =3D qemu-ga-client =3D qemu.utils.qemu_ga_client:main qmp-shell =3D qemu.qmp.qmp_shell:main qmp-shell-wrap =3D qemu.qmp.qmp_shell:main_wrap - aqmp-tui =3D qemu.qmp.aqmp_tui:main [tui] + qmp-tui =3D qemu.qmp.qmp_tui:main [tui] =20 [flake8] extend-ignore =3D E722 # Prefer pylint's bare-except checks to flake8's @@ -84,7 +84,7 @@ namespace_packages =3D True # fusepy has no type stubs: allow_subclassing_any =3D True =20 -[mypy-qemu.qmp.aqmp_tui] +[mypy-qemu.qmp.qmp_tui] # urwid and urwid_readline have no type stubs: allow_subclassing_any =3D True =20 --=20 2.34.1 From nobody Tue May 21 19:50:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650555403050986.2469189428534; Thu, 21 Apr 2022 08:36:43 -0700 (PDT) Received: from localhost ([::1]:34042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYrK-0008Uv-2i for importer@patchew.org; Thu, 21 Apr 2022 11:36:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXe-0003sq-Tt for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYXX-0005q7-7O for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:16:22 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.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-626-5vtjEtlgOka4Lf2qnVtUOw-1; Thu, 21 Apr 2022 11:16:11 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B95A13811F30; Thu, 21 Apr 2022 15:16:10 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.34.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E16F40D016A; Thu, 21 Apr 2022 15:16:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650554174; 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=oLOJ80vweeaF9iLi8ewLTw4lbIrG0wbzp0S6TpEDb7Y=; b=AyyR9xqgCITRVTn+cJrMxVU5W4iuOoH2Gp+HjHd9jEGrmA2rQQ6T5kRdwnS4lQkMhsT/jJ uTZ4PtP8H1RS5o44UF2ZT8sRAVFHFAnQlST17eP5IVbKmJuoAoo+73r+FgWAkIu2oI/s3E HARTaIKBuCtmOrXt3Ioqdg8VhA7QKlU= X-MC-Unique: 5vtjEtlgOka4Lf2qnVtUOw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PULL 17/17] python/qmp: remove pylint workaround from legacy.py Date: Thu, 21 Apr 2022 11:16:00 -0400 Message-Id: <20220421151600.984189-18-jsnow@redhat.com> In-Reply-To: <20220421151600.984189-1-jsnow@redhat.com> References: <20220421151600.984189-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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: , Cc: Kevin Wolf , Peter Maydell , Vladimir Sementsov-Ogievskiy , Beraldo Leal , qemu-block@nongnu.org, Markus Armbruster , Eduardo Habkost , Hanna Reitz , Vladimir Sementsov-Ogievskiy , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1650555404097100001 Content-Type: text/plain; charset="utf-8" Pylint upgraded recently (2.13.z) and having a pylint: disable comment in the middle of an argument field causes it some grief (It appears to stop parsing when it encounters it, causing some syntax problems). Since the duplicate line threshold was bumped up in 22305c2a081b, we don't need this workaround anymore. Drop it. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20220330172812.3427355-10-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/qmp/legacy.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/python/qemu/qmp/legacy.py b/python/qemu/qmp/legacy.py index a8629b44dff..03b5574618f 100644 --- a/python/qemu/qmp/legacy.py +++ b/python/qemu/qmp/legacy.py @@ -106,8 +106,6 @@ def __enter__(self: _T) -> _T: return self =20 def __exit__(self, - # pylint: disable=3Dduplicate-code - # see https://github.com/PyCQA/pylint/issues/3619 exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]) -> None: --=20 2.34.1