From patchwork Tue Apr 13 15:55:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Snow X-Patchwork-Id: 1465844 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=c8RY8Rgk; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FKVfX0MMZz9sTD for ; Wed, 14 Apr 2021 01:59:32 +1000 (AEST) Received: from localhost ([::1]:48882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWLRp-00058m-Ns for incoming@patchwork.ozlabs.org; Tue, 13 Apr 2021 11:59:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWLOb-0001Qn-FX for qemu-devel@nongnu.org; Tue, 13 Apr 2021 11:56:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWLOX-0000BA-9o for qemu-devel@nongnu.org; Tue, 13 Apr 2021 11:56:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618329364; 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; bh=mkf9qx30D2F5oIiW6Apw7mMkxuT36rJAl6jjUAlE2m8=; b=c8RY8RgkaLCv+3EexavroQTsJUO7RvD1JQUZL8d+oUrJ2G5WV8U+qapqj7TOkbFkUFivAL ggXrDUJ+Ykcg7vk1Vp9EMBc4/T3Z7dyLZ7bzPaVOi1LNS7beoJgVa/kqTnzHwvV2Z4yI9P AnYbM4tTRotb2HLkaFLvvUP08qetgdQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-493-4pnRDm-5PBuf5A0n3vpWXQ-1; Tue, 13 Apr 2021 11:55:59 -0400 X-MC-Unique: 4pnRDm-5PBuf5A0n3vpWXQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 736CF1020C21 for ; Tue, 13 Apr 2021 15:55:58 +0000 (UTC) Received: from scv.redhat.com (ovpn-117-61.rdu2.redhat.com [10.10.117.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 696D560DA0; Tue, 13 Apr 2021 15:55:54 +0000 (UTC) From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH RFC 0/7] RFC: Asynchronous QMP Draft Date: Tue, 13 Apr 2021 11:55:46 -0400 Message-Id: <20210413155553.2660523-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: crosa@redhat.com, John Snow , ehabkost@redhat.com, stefanha@redhat.com, armbru@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" (Does not apply to the QEMU tree; this is against a blank repository.) Hi! This is a Draft RFC for an asyncio-based Python library that implements a QMP client. The intent is to eventually publish this library directly to PyPI, so the design focus of this library is to be "useful" instead of providing as low-level an interface as possible. I am sending this to solicit general, high-level design feedback on the overal layout and approach. Many minor details are still left to be implemented, and a lot of the docstrings and documentation need to be audited to make sure they still apply as I've shuffled things around a lot in the course of development. There are some pretty notable things missing still; in particular I need to develop an Event API (there is a tiny stub added as a hack, but it's very simplistic), and I also need to develop a sync bridge so that this library could be used in existing iotests if we eventually expect to replace the old QMP library with this one. Scattered throughout these files are "RFC" comments and other "FIXME" and "TODO" items where I've tried to stub out some of the things I am still unsure of. Thanks! John Snow (7): util: asyncio-related helpers error: Error classes and so on. protocol: generic async message-based protocol loop message: add QMP Message type models: Add well-known QMP objects qmp_protocol: add QMP client implementation linter config .flake8 | 2 + error.py | 163 +++++++++++ message.py | 196 ++++++++++++++ models.py | 177 ++++++++++++ protocol.py | 704 ++++++++++++++++++++++++++++++++++++++++++++++++ pylintrc | 53 ++++ qmp_protocol.py | 420 +++++++++++++++++++++++++++++ util.py | 87 ++++++ 8 files changed, 1802 insertions(+) create mode 100644 .flake8 create mode 100644 error.py create mode 100644 message.py create mode 100644 models.py create mode 100644 protocol.py create mode 100644 pylintrc create mode 100644 qmp_protocol.py create mode 100644 util.py