From patchwork Thu May 30 11:02:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 10968609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 30EFB6C5 for ; Thu, 30 May 2019 11:04:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20BB628908 for ; Thu, 30 May 2019 11:04:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 150B528B03; Thu, 30 May 2019 11:04:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 93BC528908 for ; Thu, 30 May 2019 11:04:46 +0000 (UTC) Received: from localhost ([127.0.0.1]:52040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWIrV-0002pm-Up for patchwork-qemu-devel@patchwork.kernel.org; Thu, 30 May 2019 07:04:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWIq4-0001hu-Gt for qemu-devel@nongnu.org; Thu, 30 May 2019 07:03:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWIq3-0003Wk-5U for qemu-devel@nongnu.org; Thu, 30 May 2019 07:03:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58544) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hWIq0-0003Nc-2c; Thu, 30 May 2019 07:03:12 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id 6026930C319F; Thu, 30 May 2019 11:03:01 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-116-119.ams2.redhat.com [10.36.116.119]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC5186B8E0; Thu, 30 May 2019 11:02:59 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Thu, 30 May 2019 13:02:49 +0200 Message-Id: <20190530110255.16225-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 30 May 2019 11:03:06 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 0/6] file-posix: Add dynamic-auto-read-only QAPI feature X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, pkrempa@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This series adds optional feature lists to struct definitions in the QAPI schema and makes use of them to advertise the new behaviour of auto-read-only=on in file-posix. v4: - Build fix for tests/test-qmp-cmds v3: - Added a command using the structs types to the positive test case - Renamed QAPIDoc.SymbolPart to QAPIDoc.DocPart - Applied requested comment changes - Style fixes to avoid adding pycodestyle-3 complaints - More stylistic changes to match Markus' taste better v2: - Check that features have well-formed names instead of just checking that they are strings - Use QAPISchemaFeature objects instead of dicts - Catch duplicate feature names (and test that a feature name doesn't conflict with an object member) - Added patch 4 and 5 to add rudimentary support for features to QAPIDoc so it doesn't complain about the documentation format suggested by Markus. Used that format in the documentation of dynamic-auto-read-only. Kevin Wolf (6): qapi: Add feature flags to struct types tests/qapi-schema: Test for good feature lists in structs tests/qapi-schema: Error case tests for features in structs qapi: Disentangle QAPIDoc code qapi: Allow documentation for features file-posix: Add dynamic-auto-read-only QAPI feature qapi/block-core.json | 13 +- qapi/introspect.json | 6 +- tests/qapi-schema/features-bad-type.json | 3 + .../qapi-schema/features-duplicate-name.json | 3 + tests/qapi-schema/features-missing-name.json | 3 + tests/qapi-schema/features-name-bad-type.json | 3 + tests/qapi-schema/features-no-list.json | 3 + tests/qapi-schema/features-unknown-key.json | 3 + tests/qapi-schema/qapi-schema-test.json | 39 +++ docs/devel/qapi-code-gen.txt | 38 +++ tests/test-qmp-cmds.c | 8 + scripts/qapi/common.py | 228 +++++++++++++++--- scripts/qapi/doc.py | 15 +- scripts/qapi/introspect.py | 6 +- scripts/qapi/types.py | 3 +- scripts/qapi/visit.py | 3 +- tests/Makefile.include | 6 + tests/qapi-schema/double-type.err | 2 +- tests/qapi-schema/features-bad-type.err | 1 + tests/qapi-schema/features-bad-type.exit | 1 + tests/qapi-schema/features-bad-type.out | 0 tests/qapi-schema/features-duplicate-name.err | 1 + .../qapi-schema/features-duplicate-name.exit | 1 + tests/qapi-schema/features-duplicate-name.out | 0 tests/qapi-schema/features-missing-name.err | 1 + tests/qapi-schema/features-missing-name.exit | 1 + tests/qapi-schema/features-missing-name.out | 0 tests/qapi-schema/features-name-bad-type.err | 1 + tests/qapi-schema/features-name-bad-type.exit | 1 + tests/qapi-schema/features-name-bad-type.out | 0 tests/qapi-schema/features-no-list.err | 1 + tests/qapi-schema/features-no-list.exit | 1 + tests/qapi-schema/features-no-list.out | 0 tests/qapi-schema/features-unknown-key.err | 2 + tests/qapi-schema/features-unknown-key.exit | 1 + tests/qapi-schema/features-unknown-key.out | 0 tests/qapi-schema/qapi-schema-test.out | 43 ++++ tests/qapi-schema/test-qapi.py | 7 +- tests/qapi-schema/unknown-expr-key.err | 2 +- 39 files changed, 403 insertions(+), 47 deletions(-) create mode 100644 tests/qapi-schema/features-bad-type.json create mode 100644 tests/qapi-schema/features-duplicate-name.json create mode 100644 tests/qapi-schema/features-missing-name.json create mode 100644 tests/qapi-schema/features-name-bad-type.json create mode 100644 tests/qapi-schema/features-no-list.json create mode 100644 tests/qapi-schema/features-unknown-key.json create mode 100644 tests/qapi-schema/features-bad-type.err create mode 100644 tests/qapi-schema/features-bad-type.exit create mode 100644 tests/qapi-schema/features-bad-type.out create mode 100644 tests/qapi-schema/features-duplicate-name.err create mode 100644 tests/qapi-schema/features-duplicate-name.exit create mode 100644 tests/qapi-schema/features-duplicate-name.out create mode 100644 tests/qapi-schema/features-missing-name.err create mode 100644 tests/qapi-schema/features-missing-name.exit create mode 100644 tests/qapi-schema/features-missing-name.out create mode 100644 tests/qapi-schema/features-name-bad-type.err create mode 100644 tests/qapi-schema/features-name-bad-type.exit create mode 100644 tests/qapi-schema/features-name-bad-type.out create mode 100644 tests/qapi-schema/features-no-list.err create mode 100644 tests/qapi-schema/features-no-list.exit create mode 100644 tests/qapi-schema/features-no-list.out create mode 100644 tests/qapi-schema/features-unknown-key.err create mode 100644 tests/qapi-schema/features-unknown-key.exit create mode 100644 tests/qapi-schema/features-unknown-key.out Reviewed-by: Markus Armbruster