From nobody Sun May 19 09:42:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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 ARC-Seal: i=1; a=rsa-sha256; t=1571386772; cv=none; d=zoho.com; s=zohoarc; b=AcOaiJ33ITluocfsKwBJt8STFWv0cSamRxh1SpCughEmwTtGTb+494JPpMLrdq6vphnBpuzPswSGVB98C38d1BhBnVmaEtdjpH8nUxxOMHsBMRPIz1NFm1rVMOi6sxtAA7XHrNqO/4rJNMB2c8Kg6eJAj0+27pNIbcDGAF0v8X4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571386772; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ycunesPYubnFBC6xiCh/pwAzYAlqGJ82CQV0/e13Rcc=; b=PHe527Jvf/IOpA7sRaozXE9vzWuI3Lq1DIsVBi04KIjiNda4na+JKJM+9fmdfwApTZbM3vtrXtuMk9kzmf57jOUjaaz3hPC9k/6Z4AdVY6qNudGhZi5a5K78DwPKis36bOCmNMx946mQmLLmBoZXhmjMUWfJezrwx3Auc8lIGaI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571386772936863.0716449888811; Fri, 18 Oct 2019 01:19:32 -0700 (PDT) Received: from localhost ([::1]:36374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLNTv-0002Ab-93 for importer@patchew.org; Fri, 18 Oct 2019 04:19:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37033) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLNPX-0005N6-S4 for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:15:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLNPV-0007MZ-Jc for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:14:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38598) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLNPV-0007Lq-9w for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:14:57 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4414B3082B02; Fri, 18 Oct 2019 08:14:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.36.118.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C23EF5D71C; Fri, 18 Oct 2019 08:14:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3CE1511384A8; Fri, 18 Oct 2019 10:14:54 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v5 1/5] tests/qapi-schema: Tidy up test output indentation Date: Fri, 18 Oct 2019 10:14:50 +0200 Message-Id: <20191018081454.21369-2-armbru@redhat.com> In-Reply-To: <20191018081454.21369-1-armbru@redhat.com> References: <20191018081454.21369-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 18 Oct 2019 08:14:56 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: kwolf@redhat.com, Peter Krempa , mdroth@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Command and event details are indented three spaces, everything else four. Messed up in commit 156402e5042. Use four spaces consistently. Signed-off-by: Markus Armbruster Reviewed-by: Peter Krempa --- tests/qapi-schema/doc-good.out | 4 +- tests/qapi-schema/event-case.out | 2 +- tests/qapi-schema/indented-expr.out | 4 +- tests/qapi-schema/qapi-schema-test.out | 52 +++++++++++++------------- tests/qapi-schema/test-qapi.py | 4 +- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out index d3bca343eb..6562e1f412 100644 --- a/tests/qapi-schema/doc-good.out +++ b/tests/qapi-schema/doc-good.out @@ -46,9 +46,9 @@ object q_obj_cmd-arg member arg2: str optional=3DTrue member arg3: bool optional=3DFalse command cmd q_obj_cmd-arg -> Object - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse command cmd-boxed Object -> None - gen=3DTrue success_response=3DTrue boxed=3DTrue oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DTrue oob=3DFalse preconfig= =3DFalse doc freeform body=3D =3D Section diff --git a/tests/qapi-schema/event-case.out b/tests/qapi-schema/event-cas= e.out index ec8a1406e4..42ae519656 100644 --- a/tests/qapi-schema/event-case.out +++ b/tests/qapi-schema/event-case.out @@ -11,4 +11,4 @@ enum QType member qbool module event-case.json event oops None - boxed=3DFalse + boxed=3DFalse diff --git a/tests/qapi-schema/indented-expr.out b/tests/qapi-schema/indent= ed-expr.out index bffdf6756d..04356775cd 100644 --- a/tests/qapi-schema/indented-expr.out +++ b/tests/qapi-schema/indented-expr.out @@ -11,6 +11,6 @@ enum QType member qbool module indented-expr.json command eins None -> None - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse command zwei None -> None - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qap= i-schema-test.out index 98031da96f..aca43186a9 100644 --- a/tests/qapi-schema/qapi-schema-test.out +++ b/tests/qapi-schema/qapi-schema-test.out @@ -33,7 +33,7 @@ object Union case value3: q_empty case value4: q_empty command user_def_cmd0 Empty2 -> Empty2 - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse enum QEnumTwo prefix QENUM_TWO member value1 @@ -205,35 +205,35 @@ object SecondArrayRef member s: StatusList optional=3DFalse module qapi-schema-test.json command user_def_cmd None -> None - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse object q_obj_user_def_cmd1-arg member ud1a: UserDefOne optional=3DFalse command user_def_cmd1 q_obj_user_def_cmd1-arg -> None - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse object q_obj_user_def_cmd2-arg member ud1a: UserDefOne optional=3DFalse member ud1b: UserDefOne optional=3DTrue command user_def_cmd2 q_obj_user_def_cmd2-arg -> UserDefTwo - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse command cmd-success-response None -> None - gen=3DTrue success_response=3DFalse boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DFalse boxed=3DFalse oob=3DFalse preconfi= g=3DFalse object q_obj_guest-get-time-arg member a: int optional=3DFalse member b: int optional=3DTrue command guest-get-time q_obj_guest-get-time-arg -> int - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse object q_obj_guest-sync-arg member arg: any optional=3DFalse command guest-sync q_obj_guest-sync-arg -> any - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse command boxed-struct UserDefZero -> None - gen=3DTrue success_response=3DTrue boxed=3DTrue oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DTrue oob=3DFalse preconfig= =3DFalse command boxed-union UserDefListUnion -> None - gen=3DTrue success_response=3DTrue boxed=3DTrue oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DTrue oob=3DFalse preconfig= =3DFalse command boxed-empty Empty1 -> None - gen=3DTrue success_response=3DTrue boxed=3DTrue oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DTrue oob=3DFalse preconfig= =3DFalse command test-flags-command None -> None - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DTrue preconfig= =3DTrue + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DTrue preconfig= =3DTrue object UserDefOptions member i64: intList optional=3DTrue member u64: uint64List optional=3DTrue @@ -245,28 +245,28 @@ object EventStructOne member string: str optional=3DFalse member enum2: EnumOne optional=3DTrue event EVENT_A None - boxed=3DFalse + boxed=3DFalse event EVENT_B None - boxed=3DFalse + boxed=3DFalse object q_obj_EVENT_C-arg member a: int optional=3DTrue member b: UserDefOne optional=3DTrue member c: str optional=3DFalse event EVENT_C q_obj_EVENT_C-arg - boxed=3DFalse + boxed=3DFalse object q_obj_EVENT_D-arg member a: EventStructOne optional=3DFalse member b: str optional=3DFalse member c: str optional=3DTrue member enum3: EnumOne optional=3DTrue event EVENT_D q_obj_EVENT_D-arg - boxed=3DFalse + boxed=3DFalse event EVENT_E UserDefZero - boxed=3DTrue + boxed=3DTrue event EVENT_F UserDefFlatUnion - boxed=3DTrue + boxed=3DTrue event EVENT_G Empty1 - boxed=3DTrue + boxed=3DTrue enum __org.qemu_x-Enum member __org.qemu_x-value object __org.qemu_x-Base @@ -297,7 +297,7 @@ alternate __org.qemu_x-Alt tag type case __org.qemu_x-branch: __org.qemu_x-Base event __ORG.QEMU_X-EVENT __org.qemu_x-Struct - boxed=3DFalse + boxed=3DFalse array __org.qemu_x-EnumList __org.qemu_x-Enum array __org.qemu_x-StructList __org.qemu_x-Struct object q_obj___org.qemu_x-command-arg @@ -306,7 +306,7 @@ object q_obj___org.qemu_x-command-arg member c: __org.qemu_x-Union2 optional=3DFalse member d: __org.qemu_x-Alt optional=3DFalse command __org.qemu_x-command q_obj___org.qemu_x-command-arg -> __org.qemu_= x-Union1 - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse object TestIfStruct member foo: int optional=3DFalse member bar: int optional=3DFalse @@ -335,7 +335,7 @@ object q_obj_TestIfUnionCmd-arg member union_cmd_arg: TestIfUnion optional=3DFalse if ['defined(TEST_IF_UNION)'] command TestIfUnionCmd q_obj_TestIfUnionCmd-arg -> None - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse if ['defined(TEST_IF_UNION)'] alternate TestIfAlternate tag type @@ -347,7 +347,7 @@ object q_obj_TestIfAlternateCmd-arg member alt_cmd_arg: TestIfAlternate optional=3DFalse if ['defined(TEST_IF_ALT)'] command TestIfAlternateCmd q_obj_TestIfAlternateCmd-arg -> None - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse if ['defined(TEST_IF_ALT)'] object q_obj_TestIfCmd-arg member foo: TestIfStruct optional=3DFalse @@ -355,10 +355,10 @@ object q_obj_TestIfCmd-arg if ['defined(TEST_IF_CMD_BAR)'] if ['defined(TEST_IF_CMD)', 'defined(TEST_IF_STRUCT)'] command TestIfCmd q_obj_TestIfCmd-arg -> UserDefThree - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse if ['defined(TEST_IF_CMD)', 'defined(TEST_IF_STRUCT)'] command TestCmdReturnDefThree None -> UserDefThree - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse array TestIfEnumList TestIfEnum if ['defined(TEST_IF_ENUM)'] object q_obj_TestIfEvent-arg @@ -367,7 +367,7 @@ object q_obj_TestIfEvent-arg if ['defined(TEST_IF_EVT_BAR)'] if ['defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT)'] event TestIfEvent q_obj_TestIfEvent-arg - boxed=3DFalse + boxed=3DFalse if ['defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT)'] object FeatureStruct0 member foo: int optional=3DFalse @@ -411,4 +411,4 @@ object q_obj_test-features-arg member cfs2: CondFeatureStruct2 optional=3DFalse member cfs3: CondFeatureStruct3 optional=3DFalse command test-features q_obj_test-features-arg -> None - gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index 664254618a..29d9435bf7 100755 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -76,13 +76,13 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor): print('command %s %s -> %s' % (name, arg_type and arg_type.name, ret_type and ret_type.name)) - print(' gen=3D%s success_response=3D%s boxed=3D%s oob=3D%s preco= nfig=3D%s' + print(' gen=3D%s success_response=3D%s boxed=3D%s oob=3D%s prec= onfig=3D%s' % (gen, success_response, boxed, allow_oob, allow_preconfig)) self._print_if(ifcond) =20 def visit_event(self, name, info, ifcond, arg_type, boxed): print('event %s %s' % (name, arg_type and arg_type.name)) - print(' boxed=3D%s' % boxed) + print(' boxed=3D%s' % boxed) self._print_if(ifcond) =20 @staticmethod --=20 2.21.0 From nobody Sun May 19 09:42:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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 ARC-Seal: i=1; a=rsa-sha256; t=1571386628; cv=none; d=zoho.com; s=zohoarc; b=U8UQulrSsOC2Fkf4Mu4b+eTiJtFl0romJWQ1gCZ5vu1okDf8opWwr8pO4rU/Gan/g62TFWjYbYnM3rIKMogtoeRKLH6FdWBpB2fdJqdPFyySLh6GL2ejSFLIgF0/lbht66P1w027syNlV8rVeZD5n/8ncSh5fcqkX6cctB0oUdk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571386628; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=j7F2Co7paSIO319FG4yKf2pDCpp40eneCx66mFlT3bc=; b=IHIffQbhEk+twnuyI2Un4xXAKjGH1wu6LCfDCMB7ju8YwKW1A6SZLOYBTSKjLOxHlbXrjToQBayev88pGL6oOv73hHoQtaKVxg9mD9BWHtNChVKgCTKq5mYEGtGiGGQMWboFPAO4xcsvU0iKBr3TRp6xn+t77orzRfCkGJYvo4A= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571386628160637.5568905551215; Fri, 18 Oct 2019 01:17:08 -0700 (PDT) Received: from localhost ([::1]:36350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLNRT-0007A4-7K for importer@patchew.org; Fri, 18 Oct 2019 04:16:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37035) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLNPX-0005N8-Rb for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:15:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLNPV-0007Ml-Lm for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:14:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37876) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLNPV-0007Lu-Cf for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:14:57 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B9B058383; Fri, 18 Oct 2019 08:14:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.36.118.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C846B5D772; Fri, 18 Oct 2019 08:14:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3FDC91133034; Fri, 18 Oct 2019 10:14:54 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v5 2/5] qapi: Add feature flags to commands Date: Fri, 18 Oct 2019 10:14:51 +0200 Message-Id: <20191018081454.21369-3-armbru@redhat.com> In-Reply-To: <20191018081454.21369-1-armbru@redhat.com> References: <20191018081454.21369-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Fri, 18 Oct 2019 08:14:56 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: kwolf@redhat.com, Peter Krempa , mdroth@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Peter Krempa Similarly to features for struct types introduce the feature flags also for commands. This will allow notifying management layers of fixes and compatible changes in the behaviour of a command which may not be detectable any other way. The changes were heavily inspired by commit 6a8c0b51025. Signed-off-by: Peter Krempa Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- docs/devel/qapi-code-gen.txt | 10 ++++++---- qapi/introspect.json | 6 +++++- scripts/qapi/commands.py | 3 ++- scripts/qapi/doc.py | 4 +++- scripts/qapi/expr.py | 35 +++++++++++++++++++--------------- scripts/qapi/introspect.py | 7 ++++++- scripts/qapi/schema.py | 22 +++++++++++++++++---- tests/qapi-schema/test-qapi.py | 3 ++- 8 files changed, 62 insertions(+), 28 deletions(-) diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt index 64d9e4c6a9..45c93a43cc 100644 --- a/docs/devel/qapi-code-gen.txt +++ b/docs/devel/qapi-code-gen.txt @@ -457,7 +457,8 @@ Syntax: '*gen': false, '*allow-oob': true, '*allow-preconfig': true, - '*if': COND } + '*if': COND, + '*features': FEATURES } =20 Member 'command' names the command. =20 @@ -640,9 +641,10 @@ change in the QMP syntax (usually by allowing values o= r operations that previously resulted in an error). QMP clients may still need to know whether the extension is available. =20 -For this purpose, a list of features can be specified for a struct type. -This is exposed to the client as a list of string, where each string -signals that this build of QEMU shows a certain behaviour. +For this purpose, a list of features can be specified for a command or +struct type. This is exposed to the client as a list of strings, +where each string signals that this build of QEMU shows a certain +behaviour. =20 Each member of the 'features' array defines a feature. It can either be { 'name': STRING, '*if': COND }, or STRING, which is shorthand for diff --git a/qapi/introspect.json b/qapi/introspect.json index 1843c1cb17..031a954fa9 100644 --- a/qapi/introspect.json +++ b/qapi/introspect.json @@ -266,13 +266,17 @@ # @allow-oob: whether the command allows out-of-band execution, # defaults to false (Since: 2.12) # +# @features: names of features associated with the command, in no particul= ar +# order. (since 4.2) +# # TODO: @success-response (currently irrelevant, because it's QGA, not QMP) # # Since: 2.5 ## { 'struct': 'SchemaInfoCommand', 'data': { 'arg-type': 'str', 'ret-type': 'str', - '*allow-oob': 'bool' } } + '*allow-oob': 'bool', + '*features': [ 'str' ] } } =20 ## # @SchemaInfoEvent: diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index 898516b086..ab98e504f3 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -277,7 +277,8 @@ void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds); genc.add(gen_registry(self._regy.get_content(), self._prefix)) =20 def visit_command(self, name, info, ifcond, arg_type, ret_type, gen, - success_response, boxed, allow_oob, allow_preconfig): + success_response, boxed, allow_oob, allow_preconfig, + features): if not gen: return # FIXME: If T is a user-defined type, the user is responsible diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py index dc8919bab7..6d5726cf6e 100644 --- a/scripts/qapi/doc.py +++ b/scripts/qapi/doc.py @@ -249,12 +249,14 @@ class QAPISchemaGenDocVisitor(QAPISchemaVisitor): body=3Dtexi_entity(doc, 'Members', ifcond))) =20 def visit_command(self, name, info, ifcond, arg_type, ret_type, gen, - success_response, boxed, allow_oob, allow_preconfig): + success_response, boxed, allow_oob, allow_preconfig, + features): doc =3D self.cur_doc if boxed: body =3D texi_body(doc) body +=3D ('\n@b{Arguments:} the members of @code{%s}\n' % arg_type.name) + body +=3D texi_features(doc) body +=3D texi_sections(doc, ifcond) else: body =3D texi_entity(doc, 'Arguments', ifcond) diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index da23063f57..5a7e548899 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -184,6 +184,22 @@ def normalize_features(features): for f in features] =20 =20 +def check_features(features, info): + if features is None: + return + if not isinstance(features, list): + raise QAPISemError(info, "'features' must be an array") + for f in features: + source =3D "'features' member" + assert isinstance(f, dict) + check_keys(f, info, source, ['name'], ['if']) + check_name_is_str(f['name'], info, source) + source =3D "%s '%s'" % (source, f['name']) + check_name_str(f['name'], info, source) + check_if(f, info, source) + normalize_if(f) + + def normalize_enum(expr): if isinstance(expr['data'], list): expr['data'] =3D [m if isinstance(m, dict) else {'name': m} @@ -216,23 +232,10 @@ def check_enum(expr, info): def check_struct(expr, info): name =3D expr['struct'] members =3D expr['data'] - features =3D expr.get('features') =20 check_type(members, info, "'data'", allow_dict=3Dname) check_type(expr.get('base'), info, "'base'") - - if features: - if not isinstance(features, list): - raise QAPISemError(info, "'features' must be an array") - for f in features: - source =3D "'features' member" - assert isinstance(f, dict) - check_keys(f, info, source, ['name'], ['if']) - check_name_is_str(f['name'], info, source) - source =3D "%s '%s'" % (source, f['name']) - check_name_str(f['name'], info, source) - check_if(f, info, source) - normalize_if(f) + check_features(expr.get('features'), info) =20 =20 def check_union(expr, info): @@ -282,6 +285,7 @@ def check_command(expr, info): raise QAPISemError(info, "'boxed': true requires 'data'") check_type(args, info, "'data'", allow_dict=3Dnot boxed) check_type(rets, info, "'returns'", allow_array=3DTrue) + check_features(expr.get('features'), info) =20 =20 def check_event(expr, info): @@ -357,10 +361,11 @@ def check_exprs(exprs): elif meta =3D=3D 'command': check_keys(expr, info, meta, ['command'], - ['data', 'returns', 'boxed', 'if', + ['data', 'returns', 'boxed', 'if', 'features', 'gen', 'success-response', 'allow-oob', 'allow-preconfig']) normalize_members(expr.get('data')) + normalize_features(expr.get('features')) check_command(expr, info) elif meta =3D=3D 'event': check_keys(expr, info, meta, diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 4f257591de..b3a463dd8b 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -211,13 +211,18 @@ const QLitObject %(c_name)s =3D %(c_string)s; for m in variants.variants]}, ifcond) =20 def visit_command(self, name, info, ifcond, arg_type, ret_type, gen, - success_response, boxed, allow_oob, allow_preconfig): + success_response, boxed, allow_oob, allow_preconfig, + features): arg_type =3D arg_type or self._schema.the_empty_object_type ret_type =3D ret_type or self._schema.the_empty_object_type obj =3D {'arg-type': self._use_type(arg_type), 'ret-type': self._use_type(ret_type)} if allow_oob: obj['allow-oob'] =3D allow_oob + + if features: + obj['features'] =3D [(f.name, {'if': f.ifcond}) for f in featu= res] + self._gen_qlit(name, 'command', obj, ifcond) =20 def visit_event(self, name, info, ifcond, arg_type, boxed): diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index 38041098bd..8a48231766 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -109,7 +109,8 @@ class QAPISchemaVisitor(object): pass =20 def visit_command(self, name, info, ifcond, arg_type, ret_type, gen, - success_response, boxed, allow_oob, allow_preconfig): + success_response, boxed, allow_oob, allow_preconfig, + features): pass =20 def visit_event(self, name, info, ifcond, arg_type, boxed): @@ -658,10 +659,14 @@ class QAPISchemaCommand(QAPISchemaEntity): meta =3D 'command' =20 def __init__(self, name, info, doc, ifcond, arg_type, ret_type, - gen, success_response, boxed, allow_oob, allow_preconfig): + gen, success_response, boxed, allow_oob, allow_preconfig, + features): QAPISchemaEntity.__init__(self, name, info, doc, ifcond) assert not arg_type or isinstance(arg_type, str) assert not ret_type or isinstance(ret_type, str) + for f in features: + assert isinstance(f, QAPISchemaFeature) + f.set_defined_in(name) self._arg_type_name =3D arg_type self.arg_type =3D None self._ret_type_name =3D ret_type @@ -671,6 +676,7 @@ class QAPISchemaCommand(QAPISchemaEntity): self.boxed =3D boxed self.allow_oob =3D allow_oob self.allow_preconfig =3D allow_preconfig + self.features =3D features =20 def check(self, schema): QAPISchemaEntity.check(self, schema) @@ -700,13 +706,19 @@ class QAPISchemaCommand(QAPISchemaEntity): "command's 'returns' cannot take %s" % self.ret_type.describe()) =20 + # Features are in a name space separate from members + seen =3D {} + for f in self.features: + f.check_clash(self.info, seen) + def visit(self, visitor): QAPISchemaEntity.visit(self, visitor) visitor.visit_command(self.name, self.info, self.ifcond, self.arg_type, self.ret_type, self.gen, self.success_response, self.boxed, self.allow_oob, - self.allow_preconfig) + self.allow_preconfig, + self.features) =20 =20 class QAPISchemaEvent(QAPISchemaEntity): @@ -983,6 +995,7 @@ class QAPISchema(object): allow_oob =3D expr.get('allow-oob', False) allow_preconfig =3D expr.get('allow-preconfig', False) ifcond =3D expr.get('if') + features =3D expr.get('features', []) if isinstance(data, OrderedDict): data =3D self._make_implicit_object_type( name, info, doc, ifcond, 'arg', self._make_members(data, i= nfo)) @@ -991,7 +1004,8 @@ class QAPISchema(object): rets =3D self._make_array_type(rets[0], info) self._def_entity(QAPISchemaCommand(name, info, doc, ifcond, data, = rets, gen, success_response, - boxed, allow_oob, allow_preconf= ig)) + boxed, allow_oob, allow_preconf= ig, + self._make_features(features, i= nfo))) =20 def _def_event(self, expr, info, doc): name =3D expr['event'] diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index 29d9435bf7..d31ac4bbb7 100755 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -72,7 +72,8 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor): self._print_if(ifcond) =20 def visit_command(self, name, info, ifcond, arg_type, ret_type, gen, - success_response, boxed, allow_oob, allow_preconfig): + success_response, boxed, allow_oob, allow_preconfig, + features): print('command %s %s -> %s' % (name, arg_type and arg_type.name, ret_type and ret_type.name)) --=20 2.21.0 From nobody Sun May 19 09:42:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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 ARC-Seal: i=1; a=rsa-sha256; t=1571386627; cv=none; d=zoho.com; s=zohoarc; b=ZMcRp/ec+buy1wZP2gHCgi7EU5ko9Ano+vfOHnlz37dlckFoDaFoQMiM0DbcfNcjgVpgl2GF0KNOZ3wlpCNFvnfyMzPb7EZ3o8+XhKB2nIU468F9JvCGXXEoRLOeDhjP2+zomhsRRaP9AvltpteWiPMFeWOMNKxzM0/9trqyDEE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571386627; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EqMrvd1BLFp+XtwoOv43yK2sfqrqyMTJjl30hpp0prE=; b=kT5x31iSSKsCq/JinsVhSayC0/izOIYidLkr/ebAj3IAn6DDaRp522H6PNTkH1p9dGkLpuNFZ2I8K1C+2UHvuBVJlkP/DOh6fD7mK4QqUciodN2Gx/vBTv+J6OirShbGj0gCi4ZBVADngSCldDB7BERHihmjdnoT/BA4DNRWb4A= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571386627961401.80138480565256; Fri, 18 Oct 2019 01:17:07 -0700 (PDT) Received: from localhost ([::1]:36352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLNRW-0007Co-UH for importer@patchew.org; Fri, 18 Oct 2019 04:17:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37025) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLNPX-0005N5-S1 for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:15:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLNPV-0007MU-J0 for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:14:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48930) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLNPV-0007Ln-9y for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:14:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 45D3558E23; Fri, 18 Oct 2019 08:14:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.36.118.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC6981001B0B; Fri, 18 Oct 2019 08:14:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4374B1132D6D; Fri, 18 Oct 2019 10:14:54 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v5 3/5] tests: qapi: Test 'features' of commands Date: Fri, 18 Oct 2019 10:14:52 +0200 Message-Id: <20191018081454.21369-4-armbru@redhat.com> In-Reply-To: <20191018081454.21369-1-armbru@redhat.com> References: <20191018081454.21369-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 18 Oct 2019 08:14:56 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: kwolf@redhat.com, Peter Krempa , mdroth@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Peter Krempa Signed-off-by: Peter Krempa Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- tests/test-qmp-cmds.c | 24 ++++++++++++++++++++++++ tests/qapi-schema/qapi-schema-test.json | 18 ++++++++++++++++++ tests/qapi-schema/qapi-schema-test.out | 23 +++++++++++++++++++++++ tests/qapi-schema/test-qapi.py | 13 +++++++++---- 4 files changed, 74 insertions(+), 4 deletions(-) diff --git a/tests/test-qmp-cmds.c b/tests/test-qmp-cmds.c index 36fdf5b115..27b0afe55a 100644 --- a/tests/test-qmp-cmds.c +++ b/tests/test-qmp-cmds.c @@ -51,6 +51,30 @@ void qmp_test_features(FeatureStruct0 *fs0, FeatureStruc= t1 *fs1, { } =20 +void qmp_test_command_features0(Error **errp) +{ +} + +void qmp_test_command_features1(Error **errp) +{ +} + +void qmp_test_command_features3(Error **errp) +{ +} + +void qmp_test_command_cond_features1(Error **errp) +{ +} + +void qmp_test_command_cond_features2(Error **errp) +{ +} + +void qmp_test_command_cond_features3(Error **errp) +{ +} + UserDefTwo *qmp_user_def_cmd2(UserDefOne *ud1a, bool has_udb1, UserDefOne *ud1b, Error **errp) diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qa= pi-schema-test.json index 75c42eb0e3..9abf175fe0 100644 --- a/tests/qapi-schema/qapi-schema-test.json +++ b/tests/qapi-schema/qapi-schema-test.json @@ -290,3 +290,21 @@ 'cfs1': 'CondFeatureStruct1', 'cfs2': 'CondFeatureStruct2', 'cfs3': 'CondFeatureStruct3' } } + +# test 'features' for command + +{ 'command': 'test-command-features0', + 'features': [] } +{ 'command': 'test-command-features1', + 'features': [ 'feature1' ] } +{ 'command': 'test-command-features3', + 'features': [ 'feature1', 'feature2' ] } + +{ 'command': 'test-command-cond-features1', + 'features': [ { 'name': 'feature1', 'if': 'defined(TEST_IF_FEATURE_1)'} = ] } +{ 'command': 'test-command-cond-features2', + 'features': [ { 'name': 'feature1', 'if': 'defined(TEST_IF_FEATURE_1)'}, + { 'name': 'feature2', 'if': 'defined(TEST_IF_FEATURE_2)'} = ] } +{ 'command': 'test-command-cond-features3', + 'features': [ { 'name': 'feature1', 'if': [ 'defined(TEST_IF_COND_1)', + 'defined(TEST_IF_COND_2)'] }= ] } diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qap= i-schema-test.out index aca43186a9..3660e75a48 100644 --- a/tests/qapi-schema/qapi-schema-test.out +++ b/tests/qapi-schema/qapi-schema-test.out @@ -412,3 +412,26 @@ object q_obj_test-features-arg member cfs3: CondFeatureStruct3 optional=3DFalse command test-features q_obj_test-features-arg -> None gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse +command test-command-features0 None -> None + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse +command test-command-features1 None -> None + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + feature feature1 +command test-command-features3 None -> None + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + feature feature1 + feature feature2 +command test-command-cond-features1 None -> None + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + feature feature1 + if ['defined(TEST_IF_FEATURE_1)'] +command test-command-cond-features2 None -> None + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + feature feature1 + if ['defined(TEST_IF_FEATURE_1)'] + feature feature2 + if ['defined(TEST_IF_FEATURE_2)'] +command test-command-cond-features3 None -> None + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + feature feature1 + if ['defined(TEST_IF_COND_1)', 'defined(TEST_IF_COND_2)'] diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index d31ac4bbb7..2bd9fd8742 100755 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -61,10 +61,7 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor): self._print_if(m.ifcond, 8) self._print_variants(variants) self._print_if(ifcond) - if features: - for f in features: - print(' feature %s' % f.name) - self._print_if(f.ifcond, 8) + self._print_features(features) =20 def visit_alternate_type(self, name, info, ifcond, variants): print('alternate %s' % name) @@ -80,6 +77,7 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor): print(' gen=3D%s success_response=3D%s boxed=3D%s oob=3D%s prec= onfig=3D%s' % (gen, success_response, boxed, allow_oob, allow_preconfig)) self._print_if(ifcond) + self._print_features(features) =20 def visit_event(self, name, info, ifcond, arg_type, boxed): print('event %s %s' % (name, arg_type and arg_type.name)) @@ -99,6 +97,13 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor): if ifcond: print('%sif %s' % (' ' * indent, ifcond)) =20 + @classmethod + def _print_features(cls, features): + if features: + for f in features: + print(' feature %s' % f.name) + cls._print_if(f.ifcond, 8) + =20 def test_frontend(fname): schema =3D QAPISchema(fname) --=20 2.21.0 From nobody Sun May 19 09:42:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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 ARC-Seal: i=1; a=rsa-sha256; t=1571386627; cv=none; d=zoho.com; s=zohoarc; b=QafEouEhJCqvhMtS0HSmMO32eQ4KL0abbkXZe50rBaoYoOscAzTiUa6pDOF196SwdKm1LCQbY5BXS86P8RA72AbHNi2d9lK/Db/I5gOqnwUECk3BSHKjvOjQzrSU4szLh7SRZJ2Sm9k6r4U4+OwrwHa9Z2uvjFien2GiWFasu3E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571386627; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3ZAB7398mM1B6/TVEJeTnPc/WOIVLral56K+y3wIA3g=; b=jsVkdZ/NJnGTPJ6zSTeaemZdV6yGyCA87Z374+7QNKg5sUbfY60ufjaAEuVwARFG40eHglryCAgmYjBXLf3TojOeq1SauQtcrMACc8KEYPtTavGnHex0l6RPXuU8TeJJxJhP5ilkjz66jcmFYTK5Q76fZF7JRsce6bYABpt9KF8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571386627701117.91656241827502; Fri, 18 Oct 2019 01:17:07 -0700 (PDT) Received: from localhost ([::1]:36348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLNRS-00077H-23 for importer@patchew.org; Fri, 18 Oct 2019 04:16:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37019) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLNPX-0005N3-TY for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:15:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLNPV-0007MP-Il for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:14:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24206) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLNPV-0007Ll-9v for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:14:57 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C58685539; Fri, 18 Oct 2019 08:14:56 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.36.118.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C831F196B2; Fri, 18 Oct 2019 08:14:55 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 467E91132A05; Fri, 18 Oct 2019 10:14:54 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v5 4/5] tests/qapi-schema: Cover feature documentation comments Date: Fri, 18 Oct 2019 10:14:53 +0200 Message-Id: <20191018081454.21369-5-armbru@redhat.com> In-Reply-To: <20191018081454.21369-1-armbru@redhat.com> References: <20191018081454.21369-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 18 Oct 2019 08:14:56 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: kwolf@redhat.com, mdroth@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Commit 8aa3a33e44 "tests/qapi-schema: Test for good feature lists in structs" neglected to cover documentation comments, and the previous commit followed its example. Make up for them. Signed-off-by: Markus Armbruster --- tests/qapi-schema/doc-good.texi | 22 ++++++++++++++++++++++ tests/qapi-schema/doc-good.json | 17 +++++++++++++++-- tests/qapi-schema/doc-good.out | 5 +++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.t= exi index 2526abc6d9..2ce8b883c9 100644 --- a/tests/qapi-schema/doc-good.texi +++ b/tests/qapi-schema/doc-good.texi @@ -122,6 +122,12 @@ Not documented @*@b{If:} @code{defined(IFSTR)} @end table =20 +@b{Features:} +@table @asis +@item @code{variant1-feat} +a feature +@end table + @end deftp =20 =20 @@ -182,6 +188,14 @@ argument Not documented @end table =20 +@b{Features:} +@table @asis +@item @code{cmd-feat1} +a feature +@item @code{cmd-feat2} +another feature +@end table + @b{Note:} @code{arg3} is undocumented =20 @@ -227,6 +241,14 @@ If you're bored enough to read this, go see a video of= boxed cats =20 @b{Arguments:} the members of @code{Object} =20 +@b{Features:} +@table @asis +@item @code{cmd-feat1} +a feature +@item @code{cmd-feat2} +another feature +@end table + @b{Example:} @example -> in diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.j= son index f7fb48af38..7dc21e58a3 100644 --- a/tests/qapi-schema/doc-good.json +++ b/tests/qapi-schema/doc-good.json @@ -71,8 +71,12 @@ # A paragraph # # Another paragraph (but no @var: line) +# +# Features: +# @variant1-feat: a feature ## { 'struct': 'Variant1', + 'features': [ 'variant1-feat' ], 'data': { 'var1': { 'type': 'str', 'if': 'defined(IFSTR)' } } } =20 ## @@ -104,6 +108,10 @@ # # @arg2: the second # argument +# +# Features: +# @cmd-feat1: a feature +# @cmd-feat2: another feature # Note: @arg3 is undocumented # Returns: @Object # TODO: frobnicate @@ -123,11 +131,15 @@ ## { 'command': 'cmd', 'data': { 'arg1': 'int', '*arg2': 'str', 'arg3': 'bool' }, - 'returns': 'Object' } + 'returns': 'Object', + 'features': [ 'cmd-feat1', 'cmd-feat2' ] } =20 ## # @cmd-boxed: # If you're bored enough to read this, go see a video of boxed cats +# Features: +# @cmd-feat1: a feature +# @cmd-feat2: another feature # Example: # # -> in @@ -135,4 +147,5 @@ # <- out ## { 'command': 'cmd-boxed', 'boxed': true, - 'data': 'Object' } + 'data': 'Object', + 'features': [ 'cmd-feat1', 'cmd-feat2' ] } diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out index 6562e1f412..f78fdef6a9 100644 --- a/tests/qapi-schema/doc-good.out +++ b/tests/qapi-schema/doc-good.out @@ -20,6 +20,7 @@ object Base object Variant1 member var1: str optional=3DFalse if ['defined(IFSTR)'] + feature variant1-feat object Variant2 object Object base Base @@ -47,8 +48,12 @@ object q_obj_cmd-arg member arg3: bool optional=3DFalse command cmd q_obj_cmd-arg -> Object gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfig= =3DFalse + feature cmd-feat1 + feature cmd-feat2 command cmd-boxed Object -> None gen=3DTrue success_response=3DTrue boxed=3DTrue oob=3DFalse preconfig= =3DFalse + feature cmd-feat1 + feature cmd-feat2 doc freeform body=3D =3D Section --=20 2.21.0 From nobody Sun May 19 09:42:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.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 ARC-Seal: i=1; a=rsa-sha256; t=1571386773; cv=none; d=zoho.com; s=zohoarc; b=O64FEBWGNADbc6tEA+1LdNwYGx5JijMVKn9UR555aIffIz9EdYzQ6hfmsCzVC+vY+8bSvGj8WJOx+Hx2xqDZpJ6idXObjxlQEchmjaq/Uj/U3GiIKxpSlKTB+6/vJ7TG7mhBwZAGOqMVv5CXZWoP/lAlAPhb89+Dvbz7Mldy8F4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571386773; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fqvHUHkoMzkDXYpwiJb/KAowVcW0BcoaNbqXB5NkTrI=; b=GvCPMEkRCvtfYdkgyWPlJOw+oCAt/T/1MUNUdFyd7Ml7g7i7BrzETJg/MTWIzz4Qgl4MDKM4wAsK2I8w6JLcaxidAAmdsYWUWCOu3tjvnDXsrx4KeLrkKmBA/s+0dHbqamj4VHvnClkcUnsDD3rrSVVCHIBmXXgCQmYIse0v7m0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571386773460871.8048914327919; Fri, 18 Oct 2019 01:19:33 -0700 (PDT) Received: from localhost ([::1]:36376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLNTw-0002Ch-5W for importer@patchew.org; Fri, 18 Oct 2019 04:19:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37034) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLNPX-0005N7-TC for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:15:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLNPW-0007ND-Gq for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:14:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47642) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iLNPW-0007Ms-BK for qemu-devel@nongnu.org; Fri, 18 Oct 2019 04:14:58 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E05FC0021D7; Fri, 18 Oct 2019 08:14:57 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.36.118.123]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68A6619C77; Fri, 18 Oct 2019 08:14:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4994F1132A0B; Fri, 18 Oct 2019 10:14:54 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v5 5/5] qapi: Allow introspecting fix for savevm's cooperation with blockdev Date: Fri, 18 Oct 2019 10:14:54 +0200 Message-Id: <20191018081454.21369-6-armbru@redhat.com> In-Reply-To: <20191018081454.21369-1-armbru@redhat.com> References: <20191018081454.21369-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 18 Oct 2019 08:14:57 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: kwolf@redhat.com, Peter Krempa , mdroth@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Peter Krempa 'savevm' was buggy as it considered all monitor-owned block device nodes for snapshot. With the introduction of -blockdev, the common usage made all nodes including protocol and backing file nodes be monitor-owned and thus considered for snapshot. This is a problem since the 'file' protocol nodes can't have internal snapshots and it does not make sense to take snapshot of nodes representing backing files. This was fixed by commit 05f4aced658a02b02. Clients need to be able to detect whether this fix is present. Since savevm does not have an QMP alternative, add the feature for the 'human-monitor-command' backdoor which is used to call this command in modern use. Signed-off-by: Peter Krempa Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- qapi/misc.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qapi/misc.json b/qapi/misc.json index 6bd11f50e6..33b94e3589 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -1020,6 +1020,12 @@ # # @cpu-index: The CPU to use for commands that require an implicit CPU # +# Features: +# @savevm-monitor-nodes: If present, HMP command savevm only snapshots +# monitor-owned nodes if they have no parents. +# This allows the use of 'savevm' with +# -blockdev. (since 4.2) +# # Returns: the output of the command as a string # # Since: 0.14.0 @@ -1047,7 +1053,8 @@ ## { 'command': 'human-monitor-command', 'data': {'command-line': 'str', '*cpu-index': 'int'}, - 'returns': 'str' } + 'returns': 'str', + 'features': [ 'savevm-monitor-nodes' ] } =20 ## # @change: --=20 2.21.0