From patchwork Mon Sep 11 10:40:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Victor Toso X-Patchwork-Id: 13379162 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6FE69EE7FF4 for ; Mon, 11 Sep 2023 10:41:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfeLG-0001bf-FC; Mon, 11 Sep 2023 06:40:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLB-0001bB-RY for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeL9-0006JZ-Jv for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694428822; 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=xrBoNUvnF5WwxIYiy5B/jkgmep20TgXNMq3quTcSWtE=; b=YOOnUaQmq+YJ+sD39VT8zMsC4R8OsHQBLkj0bRYi/ZcKI7J3SepFUFl8AQTAyMVK/fp7wD 4O3UZNhjVEwkLUvzixlTAORJVs47d7tV0oWzaDwawQ1tJhjYk8PIDj1VdzwLMUwhA5Qcng oJZ24i0r4o5n/f/zSAMfg2y/pEMxo3o= 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-515-tMNa541EMu2mnaTcSyfkHg-1; Mon, 11 Sep 2023 06:40:21 -0400 X-MC-Unique: tMNa541EMu2mnaTcSyfkHg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 35D7480268A for ; Mon, 11 Sep 2023 10:40:21 +0000 (UTC) Received: from tapioca.lan (unknown [10.45.225.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 146DB10F1BE7; Mon, 11 Sep 2023 10:40:19 +0000 (UTC) From: Victor Toso To: qemu-devel@nongnu.org Cc: Markus Armbruster , John Snow , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Subject: [PATCH v2 01/11] qapi: fix example of get-win32-socket command Date: Mon, 11 Sep 2023 12:40:09 +0200 Message-ID: <20230911104017.65397-2-victortoso@redhat.com> In-Reply-To: <20230911104017.65397-1-victortoso@redhat.com> References: <20230911104017.65397-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.129.124; envelope-from=victortoso@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Example output lacks double quotes. Fix it. Fixes: 4cda177c60 "qmp: add 'get-win32-socket'" Signed-off-by: Victor Toso Reviewed-by: Daniel P. Berrangé --- qapi/misc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/misc.json b/qapi/misc.json index cda2effa81..be302cadeb 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -290,7 +290,7 @@ # # Example: # -# -> { "execute": "get-win32-socket", "arguments": { "info": "abcd123..", fdname": "skclient" } } +# -> { "execute": "get-win32-socket", "arguments": { "info": "abcd123..", "fdname": "skclient" } } # <- { "return": {} } ## { 'command': 'get-win32-socket', 'data': {'info': 'str', 'fdname': 'str'}, 'if': 'CONFIG_WIN32' } From patchwork Mon Sep 11 10:40:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Victor Toso X-Patchwork-Id: 13379166 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4CEF8EE57DF for ; Mon, 11 Sep 2023 10:42:10 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfeLK-0001eP-88; Mon, 11 Sep 2023 06:40:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLE-0001bX-PT for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLC-0006Kp-Lk for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694428824; 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=3wrGtCnKsOajyNzyJc3LTkAcPk7lnORV8XF2BFZm778=; b=DKGEiKH0MUcFH5nlkOtXkYAOWJJLTM9cqPjyB0+ga+QnQlY0bMyhraZ20nXB34ltDotXYo fPfWZKdGFDYY1skoTrBVrvhf+y3HqMNdMi3ZV7JMwZlfEYByrxRcoQWnJwl1JyZs/Sniym WsPataiNhe2Q3VIies9Sba8gYHOGs3I= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-539-uOuJhbHsPhaVC6j5wIDU1g-1; Mon, 11 Sep 2023 06:40:23 -0400 X-MC-Unique: uOuJhbHsPhaVC6j5wIDU1g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BAED53815EE5 for ; Mon, 11 Sep 2023 10:40:22 +0000 (UTC) Received: from tapioca.lan (unknown [10.45.225.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E7DC10005D4; Mon, 11 Sep 2023 10:40:21 +0000 (UTC) From: Victor Toso To: qemu-devel@nongnu.org Cc: Markus Armbruster , John Snow , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Subject: [PATCH v2 02/11] qapi: fix example of dumpdtb command Date: Mon, 11 Sep 2023 12:40:10 +0200 Message-ID: <20230911104017.65397-3-victortoso@redhat.com> In-Reply-To: <20230911104017.65397-1-victortoso@redhat.com> References: <20230911104017.65397-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.129.124; envelope-from=victortoso@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Example output has extra end curly bracket. Switch with comma. Signed-off-by: Victor Toso Reviewed-by: Daniel P. Berrangé --- qapi/machine.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/machine.json b/qapi/machine.json index a08b6576ca..9eb76193e0 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1684,7 +1684,7 @@ # # Example: # -# -> { "execute": "dumpdtb" } +# -> { "execute": "dumpdtb", # "arguments": { "filename": "fdt.dtb" } } # <- { "return": {} } ## From patchwork Mon Sep 11 10:40:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Victor Toso X-Patchwork-Id: 13379165 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1714BEEB580 for ; Mon, 11 Sep 2023 10:42:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfeLG-0001cL-Px; Mon, 11 Sep 2023 06:40:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLE-0001bY-PZ for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLC-0006LM-H3 for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694428825; 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=jKn745VaGJTa2OfUm3eakfxVKw06Ozsft+ZucfMBBq0=; b=eBwGT0rhuBBZkVUJQ4oKzZDiRHRPBwCmWDbE6+s1kJuc9BmSGRWIczCaMIUWp6kUeXRZJ0 8mmsXq2zUtEcNa7aeOIV8zkJpHbZ+8aYuzOLCguTNf2mvxdcIHUKJGKhL3H/FIfeMJvc6I 0t4iamxJ2h2co71hGXO2FGR0/66em5w= 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-222-RW900A0jMAO3ij9anR0KWA-1; Mon, 11 Sep 2023 06:40:24 -0400 X-MC-Unique: RW900A0jMAO3ij9anR0KWA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 40B85181A6E2 for ; Mon, 11 Sep 2023 10:40:24 +0000 (UTC) Received: from tapioca.lan (unknown [10.45.225.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E4C610F1BE8; Mon, 11 Sep 2023 10:40:22 +0000 (UTC) From: Victor Toso To: qemu-devel@nongnu.org Cc: Markus Armbruster , John Snow , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Subject: [PATCH v2 03/11] qapi: fix example of cancel-vcpu-dirty-limit command Date: Mon, 11 Sep 2023 12:40:11 +0200 Message-ID: <20230911104017.65397-4-victortoso@redhat.com> In-Reply-To: <20230911104017.65397-1-victortoso@redhat.com> References: <20230911104017.65397-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.133.124; envelope-from=victortoso@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Example output has extra end curly bracket. Remove it. Signed-off-by: Victor Toso Reviewed-by: Daniel P. Berrangé --- qapi/migration.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/migration.json b/qapi/migration.json index 8843e74b59..9385b9f87c 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -2010,7 +2010,7 @@ # # Example: # -# -> {"execute": "cancel-vcpu-dirty-limit"}, +# -> {"execute": "cancel-vcpu-dirty-limit", # "arguments": { "cpu-index": 1 } } # <- { "return": {} } ## From patchwork Mon Sep 11 10:40:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Victor Toso X-Patchwork-Id: 13379159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 52A4BEE7FF4 for ; Mon, 11 Sep 2023 10:41:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfeLJ-0001eV-EA; Mon, 11 Sep 2023 06:40:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLG-0001cJ-Kj for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLE-0006N4-65 for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694428827; 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=zyq0mbA5kto1muzFUnYA+ExyAjTyiHgpeYM/D8dco+M=; b=JXrVkmG69E221RPESQ7Fv/QlO0+pBlCKsyt/XThqAWxJDA5aV5XrrIBi7y5A1LJvBjwFFQ uzgRrkEJWjvAGx+IVdLR8ogKwpUtxBq963gvtpsUIHs/e7N2GML6nrlb1pXQKW7JSn7wn/ /vSygKv/J4nbm7T3zGUY7e94q7Wfk2s= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-550-LpxaacFBO--jJm9RSKwm3w-1; Mon, 11 Sep 2023 06:40:26 -0400 X-MC-Unique: LpxaacFBO--jJm9RSKwm3w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B12573C11A03 for ; Mon, 11 Sep 2023 10:40:25 +0000 (UTC) Received: from tapioca.lan (unknown [10.45.225.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 95D4710F1BEA; Mon, 11 Sep 2023 10:40:24 +0000 (UTC) From: Victor Toso To: qemu-devel@nongnu.org Cc: Markus Armbruster , John Snow , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Subject: [PATCH v2 04/11] qapi: fix example of set-vcpu-dirty-limit command Date: Mon, 11 Sep 2023 12:40:12 +0200 Message-ID: <20230911104017.65397-5-victortoso@redhat.com> In-Reply-To: <20230911104017.65397-1-victortoso@redhat.com> References: <20230911104017.65397-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.133.124; envelope-from=victortoso@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Example output has extra end curly bracket. Remove it. Signed-off-by: Victor Toso Reviewed-by: Daniel P. Berrangé --- qapi/migration.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/migration.json b/qapi/migration.json index 9385b9f87c..2658cdbcbe 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1986,7 +1986,7 @@ # # Example: # -# -> {"execute": "set-vcpu-dirty-limit"} +# -> {"execute": "set-vcpu-dirty-limit", # "arguments": { "dirty-rate": 200, # "cpu-index": 1 } } # <- { "return": {} } From patchwork Mon Sep 11 10:40:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Victor Toso X-Patchwork-Id: 13379164 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4909CEE7FF4 for ; Mon, 11 Sep 2023 10:42:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfeLK-0001fO-T0; Mon, 11 Sep 2023 06:40:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLH-0001cT-FS for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLF-0006NK-DK for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694428828; 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=BWMNMyGcVf71Ls5j64vd/eUcbF3wR7sa6rxYMq5619Q=; b=ZOynK2LXvnAUn+RBXotPc9QZf1Pld2z1uxZ9SNUVYEUKWx0lCfIxp4S6UHxg2PQM17Nnd0 3DFW5Nu5Elwe0Eq98IWIsItWsPrvmDRxoFOOYY2oa+O1XgCCCYnzkfxQvHZaZO3wTsyOD4 zB5VZrL4rVvZD4O0UdMUqx2XK1Yxuhg= 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-621-a5KhxfBNOYelFE40_m_KgA-1; Mon, 11 Sep 2023 06:40:27 -0400 X-MC-Unique: a5KhxfBNOYelFE40_m_KgA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 36EE08E4EC4 for ; Mon, 11 Sep 2023 10:40:27 +0000 (UTC) Received: from tapioca.lan (unknown [10.45.225.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E1F010F1BE9; Mon, 11 Sep 2023 10:40:25 +0000 (UTC) From: Victor Toso To: qemu-devel@nongnu.org Cc: Markus Armbruster , John Snow , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Subject: [PATCH v2 05/11] qapi: fix example of calc-dirty-rate command Date: Mon, 11 Sep 2023 12:40:13 +0200 Message-ID: <20230911104017.65397-6-victortoso@redhat.com> In-Reply-To: <20230911104017.65397-1-victortoso@redhat.com> References: <20230911104017.65397-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.129.124; envelope-from=victortoso@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Example output has property name with single quotes. Fix it. Signed-off-by: Victor Toso Reviewed-by: Daniel P. Berrangé --- qapi/migration.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/migration.json b/qapi/migration.json index 2658cdbcbe..45dac41f67 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1922,7 +1922,7 @@ # Example: # # -> {"execute": "calc-dirty-rate", "arguments": {"calc-time": 1, -# 'sample-pages': 512} } +# "sample-pages": 512} } # <- { "return": {} } ## { 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64', From patchwork Mon Sep 11 10:40:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Victor Toso X-Patchwork-Id: 13379158 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 28B68EE7FF4 for ; Mon, 11 Sep 2023 10:41:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfeLN-0001g3-0R; Mon, 11 Sep 2023 06:40:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLK-0001ef-AE for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLH-0006Ne-8E for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694428830; 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=pOtpzlK1pVnu8Haa7fjRJYVyq+ccEumvY5huxIk/gx8=; b=JG6nPwww+jG3F9p5iWqDA9TtqQ/YCuvNf+GxttozWcXnw3dBM1mdnBMqUVplF/QHWNx7x3 Ejzjpdslp4OlwsBVRx1YKY8BdlnYX+Bq+2U54joTdPIqPymjVjFmCwzgV9Skksi4qZ+afg UFa1XoWv6FmRf1qzztr0ukQPjWbqgJE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-148-nlMxnjZGNG-q7DJTTj7F6w-1; Mon, 11 Sep 2023 06:40:28 -0400 X-MC-Unique: nlMxnjZGNG-q7DJTTj7F6w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A77581C05EA6 for ; Mon, 11 Sep 2023 10:40:28 +0000 (UTC) Received: from tapioca.lan (unknown [10.45.225.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DFC910F1BE7; Mon, 11 Sep 2023 10:40:27 +0000 (UTC) From: Victor Toso To: qemu-devel@nongnu.org Cc: Markus Armbruster , John Snow , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Subject: [PATCH v2 06/11] qapi: fix example of NETDEV_STREAM_CONNECTED event Date: Mon, 11 Sep 2023 12:40:14 +0200 Message-ID: <20230911104017.65397-7-victortoso@redhat.com> In-Reply-To: <20230911104017.65397-1-victortoso@redhat.com> References: <20230911104017.65397-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.133.124; envelope-from=victortoso@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Example output was using single quotes. Fix it. Signed-off-by: Victor Toso Reviewed-by: Daniel P. Berrangé --- qapi/net.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qapi/net.json b/qapi/net.json index 313c8a606e..81988e499a 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -930,9 +930,9 @@ # # Example: # -# <- { 'event': 'NETDEV_STREAM_DISCONNECTED', -# 'data': {'netdev-id': 'netdev0'}, -# 'timestamp': {'seconds': 1663330937, 'microseconds': 526695} } +# <- { "event": "NETDEV_STREAM_DISCONNECTED", +# "data": {"netdev-id": "netdev0"}, +# "timestamp": {"seconds": 1663330937, "microseconds": 526695} } ## { 'event': 'NETDEV_STREAM_DISCONNECTED', 'data': { 'netdev-id': 'str' } } From patchwork Mon Sep 11 10:40:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Victor Toso X-Patchwork-Id: 13379161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 08F57EE57DF for ; Mon, 11 Sep 2023 10:41:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfeLU-0001l1-F9; Mon, 11 Sep 2023 06:40:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLO-0001hd-Nb for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLI-0006Nv-GI for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694428831; 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=esJZgpI2OetBTfhwd0YgJn97crLVO32WGh0GG2yQHsc=; b=jOcEDWPPNAvSC8ySKXD/d6bbd/0e2VFoZIqNsm5NRor6LFlG4u1hkj4CaKSfSBYlHuiqYx B1y2PCiDfnyoHeARogmERUzFyTL3zEvKtAmi760OrBaGLQ0JYTe12YoGquAC6TKpPknzYp +B78xngRXdV+xHFEcX5BhRmlQizxfC8= 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-619-HmwVaZmYM22iuOHjqJpW0g-1; Mon, 11 Sep 2023 06:40:30 -0400 X-MC-Unique: HmwVaZmYM22iuOHjqJpW0g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2638680379F for ; Mon, 11 Sep 2023 10:40:30 +0000 (UTC) Received: from tapioca.lan (unknown [10.45.225.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 084E51006B78; Mon, 11 Sep 2023 10:40:28 +0000 (UTC) From: Victor Toso To: qemu-devel@nongnu.org Cc: Markus Armbruster , John Snow , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Subject: [PATCH v2 07/11] qapi: fix example of query-rocker-of-dpa-flows command Date: Mon, 11 Sep 2023 12:40:15 +0200 Message-ID: <20230911104017.65397-8-victortoso@redhat.com> In-Reply-To: <20230911104017.65397-1-victortoso@redhat.com> References: <20230911104017.65397-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.129.124; envelope-from=victortoso@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Example output has a comment embedded in the array. Remove it. The end result is a list of size 1. Signed-off-by: Victor Toso Reviewed-by: Daniel P. Berrangé --- qapi/rocker.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qapi/rocker.json b/qapi/rocker.json index 31ce0b36f6..858e4f4a45 100644 --- a/qapi/rocker.json +++ b/qapi/rocker.json @@ -249,8 +249,7 @@ # "cookie": 0, # "action": {"goto-tbl": 10}, # "mask": {"in-pport": 4294901760} -# }, -# {...more...}, +# } # ]} ## { 'command': 'query-rocker-of-dpa-flows', From patchwork Mon Sep 11 10:40:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Victor Toso X-Patchwork-Id: 13379157 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9E0BCEE57DF for ; Mon, 11 Sep 2023 10:40:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfeLQ-0001iB-F4; Mon, 11 Sep 2023 06:40:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLM-0001g1-SQ for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLJ-0006O0-R3 for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694428833; 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=i7LiIiA5R1kkk1AqAufFeQ+hIvCE4yE2Nt6Y873ddIA=; b=NCXlIGgMlh8ezVkQNxi2Vp6PRcbJqFqy1sp5paj2GdUb4WwADclgGEXS7hxF+xfg+9UxKz eDg3/eTiOL8QqXObBGuxN9alAZR2lLH12fpq+KSPzHk5/ITbWuPA/rbRL2ygbEz+Vuo4jX X8iVjIkWa86/SPTJfRdo8V5QXREnb5U= 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-637-ofbGgiGMMem0fIkv3aXtIA-1; Mon, 11 Sep 2023 06:40:31 -0400 X-MC-Unique: ofbGgiGMMem0fIkv3aXtIA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 93D34101FAA1 for ; Mon, 11 Sep 2023 10:40:31 +0000 (UTC) Received: from tapioca.lan (unknown [10.45.225.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FE5910F1BE7; Mon, 11 Sep 2023 10:40:30 +0000 (UTC) From: Victor Toso To: qemu-devel@nongnu.org Cc: Markus Armbruster , John Snow , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Subject: [PATCH v2 08/11] qapi: fix example of query-spice command Date: Mon, 11 Sep 2023 12:40:16 +0200 Message-ID: <20230911104017.65397-9-victortoso@redhat.com> In-Reply-To: <20230911104017.65397-1-victortoso@redhat.com> References: <20230911104017.65397-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.129.124; envelope-from=victortoso@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Example output has a comment embedded in the array. Remove it. The end result is a list of size 2. Signed-off-by: Victor Toso Reviewed-by: Daniel P. Berrangé --- qapi/ui.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qapi/ui.json b/qapi/ui.json index 006616aa77..6ed36c45ea 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -363,8 +363,7 @@ # "host": "127.0.0.1", # "channel-id": 0, # "tls": false -# }, -# [ ... more channels follow ... ] +# } # ] # } # } From patchwork Mon Sep 11 10:40:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Victor Toso X-Patchwork-Id: 13379160 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5F7C0EE57DF for ; Mon, 11 Sep 2023 10:41:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfeLU-0001l2-FQ; Mon, 11 Sep 2023 06:40:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLO-0001he-Oa for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfeLM-0006Pd-EX for qemu-devel@nongnu.org; Mon, 11 Sep 2023 06:40:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694428835; 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=4pILwQa5XVByyZmcJe3qzgOQoK8wgSzXlF96fDGd6fg=; b=ND8sFPbHQAVmzCEsJXY75xBda68p/GLWBi337xlpojfSqU+z914FdFgvcDDigyGW+yRlYL CidbAXHUGfnbetubZovK+2DFnBnWhIx0jd9U801e0ubuX52qao4t03Aw1pZ7maMNI6IcSd 70Y4ptzS1FMBnhlOEEm8GQQ/GoLlcGI= 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-544-JWQYq9lPOpOCG8hEHsQeXg-1; Mon, 11 Sep 2023 06:40:34 -0400 X-MC-Unique: JWQYq9lPOpOCG8hEHsQeXg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 17D02916EE4 for ; Mon, 11 Sep 2023 10:40:33 +0000 (UTC) Received: from tapioca.lan (unknown [10.45.225.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id E963A10F1BE7; Mon, 11 Sep 2023 10:40:31 +0000 (UTC) From: Victor Toso To: qemu-devel@nongnu.org Cc: Markus Armbruster , John Snow , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= Subject: [PATCH v2 09/11] qapi: fix example of query-blockstats command Date: Mon, 11 Sep 2023 12:40:17 +0200 Message-ID: <20230911104017.65397-10-victortoso@redhat.com> In-Reply-To: <20230911104017.65397-1-victortoso@redhat.com> References: <20230911104017.65397-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.133.124; envelope-from=victortoso@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Example output has several missing commas. Add them. Signed-off-by: Victor Toso Reviewed-by: Daniel P. Berrangé --- qapi/block-core.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 2b1d493d6e..6a81103594 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1167,10 +1167,10 @@ # "wr_bytes":9786368, # "wr_operations":751, # "rd_bytes":122567168, -# "rd_operations":36772 -# "wr_total_times_ns":313253456 -# "rd_total_times_ns":3465673657 -# "flush_total_times_ns":49653 +# "rd_operations":36772, +# "wr_total_times_ns":313253456, +# "rd_total_times_ns":3465673657, +# "flush_total_times_ns":49653, # "flush_operations":61, # "rd_merged":0, # "wr_merged":0, @@ -1184,10 +1184,10 @@ # "wr_bytes":9786368, # "wr_operations":692, # "rd_bytes":122739200, -# "rd_operations":36604 +# "rd_operations":36604, # "flush_operations":51, -# "wr_total_times_ns":313253456 -# "rd_total_times_ns":3465673657 +# "wr_total_times_ns":313253456, +# "rd_total_times_ns":3465673657, # "flush_total_times_ns":49653, # "rd_merged":0, # "wr_merged":0, @@ -1204,10 +1204,10 @@ # "wr_bytes":0, # "wr_operations":0, # "rd_bytes":0, -# "rd_operations":0 +# "rd_operations":0, # "flush_operations":0, -# "wr_total_times_ns":0 -# "rd_total_times_ns":0 +# "wr_total_times_ns":0, +# "rd_total_times_ns":0, # "flush_total_times_ns":0, # "rd_merged":0, # "wr_merged":0, @@ -1223,10 +1223,10 @@ # "wr_bytes":0, # "wr_operations":0, # "rd_bytes":0, -# "rd_operations":0 +# "rd_operations":0, # "flush_operations":0, -# "wr_total_times_ns":0 -# "rd_total_times_ns":0 +# "wr_total_times_ns":0, +# "rd_total_times_ns":0, # "flush_total_times_ns":0, # "rd_merged":0, # "wr_merged":0, @@ -1242,10 +1242,10 @@ # "wr_bytes":0, # "wr_operations":0, # "rd_bytes":0, -# "rd_operations":0 +# "rd_operations":0, # "flush_operations":0, -# "wr_total_times_ns":0 -# "rd_total_times_ns":0 +# "wr_total_times_ns":0, +# "rd_total_times_ns":0, # "flush_total_times_ns":0, # "rd_merged":0, # "wr_merged":0, From patchwork Mon Sep 11 11:27:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Toso X-Patchwork-Id: 13379226 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id F1501EE57DF for ; Mon, 11 Sep 2023 11:27:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qff4b-0000kY-PO; Mon, 11 Sep 2023 07:27:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qff4a-0000j5-Bz for qemu-devel@nongnu.org; Mon, 11 Sep 2023 07:27:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qff4Y-0007Rx-7z for qemu-devel@nongnu.org; Mon, 11 Sep 2023 07:27:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694431637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P+tvacQu5hZfeUsgCdgM+W92SovZWWWUWdcPncNQai0=; b=M33FRETGFhPvmeap1FXkbZhZF+nSZSAiTROk8hyDjWCl1TH3bw6m2vxmjDkPCpMY+b5QwX YcxO9HRnFV8qpEVibPVUl8M4y0+9ieQcTf44/X76eeEI5DcgWYRhpRlpIwIfTO1VsJmZeG If2Yck81NDtjy3QQx0Itxmih4bqZR8k= 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-66-6Udqbm91OEGjL_9kpEjtsg-1; Mon, 11 Sep 2023 07:27:15 -0400 X-MC-Unique: 6Udqbm91OEGjL_9kpEjtsg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 98DDF182C5E5 for ; Mon, 11 Sep 2023 11:27:15 +0000 (UTC) Received: from tapioca.lan (unknown [10.45.225.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05D5B2027045 for ; Mon, 11 Sep 2023 11:27:14 +0000 (UTC) From: Victor Toso To: qemu-devel@nongnu.org Subject: [PATCH v2 10/11] qapi: meson: add test flag to allow skip generators Date: Mon, 11 Sep 2023 13:27:12 +0200 Message-ID: <20230911112713.78008-1-victortoso@redhat.com> In-Reply-To: <20230911104017.65397-1-victortoso@redhat.com> References: <20230911104017.65397-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Received-SPF: pass client-ip=170.10.133.124; envelope-from=victortoso@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The next patch adds a generator that also validates qapi documentation. We don't want to execute it with a test schema. Signed-off-by: Victor Toso --- scripts/qapi/main.py | 4 ++++ tests/meson.build | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/main.py b/scripts/qapi/main.py index 316736b6a2..7efdcc6b8d 100644 --- a/scripts/qapi/main.py +++ b/scripts/qapi/main.py @@ -33,6 +33,7 @@ def generate(schema_file: str, prefix: str, unmask: bool = False, builtins: bool = False, + test_schema: bool = False, gen_tracing: bool = False) -> None: """ Generate C code for the given schema into the target directory. @@ -75,6 +76,8 @@ def main() -> int: parser.add_argument('-u', '--unmask-non-abi-names', action='store_true', dest='unmask', help="expose non-ABI names in introspection") + parser.add_argument('-t', '--tests', action='store_true', + help="flag generator that is running with a test schema") # Option --suppress-tracing exists so we can avoid solving build system # problems. TODO Drop it when we no longer need it. @@ -96,6 +99,7 @@ def main() -> int: prefix=args.prefix, unmask=args.unmask, builtins=args.builtins, + test_schema=args.tests, gen_tracing=not args.suppress_tracing) except QAPIError as err: print(err, file=sys.stderr) diff --git a/tests/meson.build b/tests/meson.build index debaa4505e..ed0844a6a0 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -43,7 +43,7 @@ test_qapi_files = custom_target('Test QAPI files', 'qapi-schema/include/sub-module.json', 'qapi-schema/sub-sub-module.json'), command: [ qapi_gen, '-o', meson.current_build_dir(), - '-b', '-p', 'test-', '@INPUT0@', + '-t', '-b', '-p', 'test-', '@INPUT0@', '--suppress-tracing' ], depend_files: qapi_gen_depends) From patchwork Mon Sep 11 11:27:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Toso X-Patchwork-Id: 13379225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D87D4EE7FF4 for ; Mon, 11 Sep 2023 11:27:36 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qff4d-0000og-EH; Mon, 11 Sep 2023 07:27:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qff4c-0000lv-46 for qemu-devel@nongnu.org; Mon, 11 Sep 2023 07:27:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qff4Z-0007S1-5j for qemu-devel@nongnu.org; Mon, 11 Sep 2023 07:27:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694431638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+DECap47/OC5AQKOT0cOi5siluVjihmC7MKGn67a6xM=; b=dYSwdgEF7k5eygANpGBdBDovzqEz/qTTEikjaEjhfmVy6L6/siGFM0eFelUwLxv/QU4hZn RHYjb0xseEZiGvirYBxozUJvu91jiqa5NW1X2Bun2rn4i5Yj6MmPjpU7wwnFliJ1IndO9S N8oQIp0euUvr7rgKO5pGMWnYufWNtvU= 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-81-Qb6g9rnzOr2uYUfZ6_yI2Q-1; Mon, 11 Sep 2023 07:27:17 -0400 X-MC-Unique: Qb6g9rnzOr2uYUfZ6_yI2Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CD0D2816555 for ; Mon, 11 Sep 2023 11:27:16 +0000 (UTC) Received: from tapioca.lan (unknown [10.45.225.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 046832027046 for ; Mon, 11 Sep 2023 11:27:15 +0000 (UTC) From: Victor Toso To: qemu-devel@nongnu.org Subject: [PATCH v2 11/11] qapi: scripts: add a generator for qapi's examples Date: Mon, 11 Sep 2023 13:27:13 +0200 Message-ID: <20230911112713.78008-2-victortoso@redhat.com> In-Reply-To: <20230911112713.78008-1-victortoso@redhat.com> References: <20230911104017.65397-1-victortoso@redhat.com> <20230911112713.78008-1-victortoso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Received-SPF: pass client-ip=170.10.129.124; envelope-from=victortoso@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This generator has two goals: 1. Mechanical validation of QAPI examples 2. Generate the examples in a JSON format to be consumed for extra validation. The generator iterates over every Example section, parsing both server and client messages. The generator prints any inconsistency found, for example: | Error: Extra data: line 1 column 39 (char 38) | Location: cancel-vcpu-dirty-limit at qapi/migration.json:2017 | Data: {"execute": "cancel-vcpu-dirty-limit"}, | "arguments": { "cpu-index": 1 } } The generator will output other JSON file with all the examples in the QAPI module that they came from. This can be used to validate the introspection between QAPI/QMP to language bindings, for example: | { "examples": [ | { | "id": "ksuxwzfayw", | "client": [ | { | "sequence-order": 1 | "message-type": "command", | "message": | { "arguments": | { "device": "scratch", "size": 1073741824 }, | "execute": "block_resize" | }, | } ], | "server": [ | { | "sequence-order": 2 | "message-type": "return", | "message": { "return": {} }, | } ] | } | ] } Note that the order matters, as read by the Example section and translated into "sequence-order". A language binding project can then consume this files to Marshal and Unmarshal, comparing if the results are what is to be expected. RFC discussion: https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg04641.html Signed-off-by: Victor Toso --- scripts/qapi/dumpexamples.py | 204 +++++++++++++++++++++++++++++++++++ scripts/qapi/main.py | 5 +- 2 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 scripts/qapi/dumpexamples.py diff --git a/scripts/qapi/dumpexamples.py b/scripts/qapi/dumpexamples.py new file mode 100644 index 0000000000..5a1c275bc8 --- /dev/null +++ b/scripts/qapi/dumpexamples.py @@ -0,0 +1,204 @@ +""" +Dump examples for Developers +""" +# Copyright (c) 2023 Red Hat Inc. +# +# Authors: +# Victor Toso +# +# This work is licensed under the terms of the GNU GPL, version 2. +# See the COPYING file in the top-level directory. + +# Just for type hint on self +from __future__ import annotations + +import os +import json +import random +import string + +from typing import Dict, List, Optional + +from .schema import ( + QAPISchema, + QAPISchemaType, + QAPISchemaVisitor, + QAPISchemaEnumMember, + QAPISchemaFeature, + QAPISchemaIfCond, + QAPISchemaObjectType, + QAPISchemaObjectTypeMember, + QAPISchemaVariants, +) +from .source import QAPISourceInfo + + +def gen_examples(schema: QAPISchema, + output_dir: str, + prefix: str) -> None: + vis = QAPISchemaGenExamplesVisitor(prefix) + schema.visit(vis) + vis.write(output_dir) + + +def get_id(random, size: int) -> str: + letters = string.ascii_lowercase + return ''.join(random.choice(letters) for i in range(size)) + + +def next_object(text, start, end, context) -> (Dict, bool): + # Start of json object + start = text.find("{", start) + end = text.rfind("}", start, end+1) + + # try catch, pretty print issues + try: + ret = json.loads(text[start:end+1]) + except Exception as e: + print("Error: {}\nLocation: {}\nData: {}\n".format( + str(e), context, text[start:end+1])) + return {}, True + else: + return ret, False + + +def parse_text_to_dicts(text: str, context: str) -> (List[Dict], bool): + examples, clients, servers = [], [], [] + failed = False + + count = 1 + c, s = text.find("->"), text.find("<-") + while c != -1 or s != -1: + if c == -1 or (s != -1 and s < c): + start, target = s, servers + else: + start, target = c, clients + + # Find the client and server, if any + if c != -1: + c = text.find("->", start + 1) + if s != -1: + s = text.find("<-", start + 1) + + # Find the limit of current's object. + # We first look for the next message, either client or server. If none + # is avaible, we set the end of the text as limit. + if c == -1 and s != -1: + end = s + elif c != -1 and s == -1: + end = c + elif c != -1 and s != -1: + end = (c < s) and c or s + else: + end = len(text) - 1 + + message, error = next_object(text, start, end, context) + if error: + failed = True + + if len(message) > 0: + message_type = "return" + if "execute" in message: + message_type = "command" + elif "event" in message: + message_type = "event" + + target.append({ + "sequence-order": count, + "message-type": message_type, + "message": message + }) + count += 1 + + examples.append({"client": clients, "server": servers}) + return examples, failed + + +def parse_examples_of(self: QAPISchemaGenExamplesVisitor, + name: str): + + assert(name in self.schema._entity_dict) + obj = self.schema._entity_dict[name] + assert((obj.doc is not None)) + module_name = obj._module.name + + # We initialize random with the name so that we get consistent example + # ids over different generations. The ids of a given example might + # change when adding/removing examples, but that's acceptable as the + # goal is just to grep $id to find what example failed at a given test + # with minimum chorn over regenerating. + random.seed(name, version=2) + + for s in obj.doc.sections: + if s.name != "Example": + continue + + if module_name not in self.target: + self.target[module_name] = [] + + context = f'''{name} at {obj.info.fname}:{obj.info.line}''' + examples, failed = parse_text_to_dicts(s.text, context) + if failed: + # To warn user that docs needs fixing + self.failed = True + + for example in examples: + self.target[module_name].append({ + "id": get_id(random, 10), + "client": example["client"], + "server": example["server"] + }) + + +class QAPISchemaGenExamplesVisitor(QAPISchemaVisitor): + + def __init__(self, prefix: str): + super().__init__() + self.target = {} + self.schema = None + self.failed = False + + def visit_begin(self, schema): + self.schema = schema + + def visit_end(self): + self.schema = None + assert not self.failed, "Should fix the docs" + + def write(self: QAPISchemaGenExamplesVisitor, + output_dir: str) -> None: + for filename, content in self.target.items(): + pathname = os.path.join(output_dir, "examples", filename) + odir = os.path.dirname(pathname) + os.makedirs(odir, exist_ok=True) + result = {"examples": content} + + with open(pathname, "w") as outfile: + outfile.write(json.dumps(result, indent=2, sort_keys=True)) + + def visit_command(self: QAPISchemaGenExamplesVisitor, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + arg_type: Optional[QAPISchemaObjectType], + ret_type: Optional[QAPISchemaType], + gen: bool, + success_response: bool, + boxed: bool, + allow_oob: bool, + allow_preconfig: bool, + coroutine: bool) -> None: + + if gen: + parse_examples_of(self, name) + + def visit_event(self: QAPISchemaGenExamplesVisitor, + name: str, + info: Optional[QAPISourceInfo], + ifcond: QAPISchemaIfCond, + features: List[QAPISchemaFeature], + arg_type: Optional[QAPISchemaObjectType], + boxed: bool): + + parse_examples_of(self, name) diff --git a/scripts/qapi/main.py b/scripts/qapi/main.py index 7efdcc6b8d..9d71d78b55 100644 --- a/scripts/qapi/main.py +++ b/scripts/qapi/main.py @@ -13,6 +13,7 @@ from .commands import gen_commands from .common import must_match +from .dumpexamples import gen_examples from .error import QAPIError from .events import gen_events from .introspect import gen_introspect @@ -54,7 +55,9 @@ def generate(schema_file: str, gen_commands(schema, output_dir, prefix, gen_tracing) gen_events(schema, output_dir, prefix) gen_introspect(schema, output_dir, prefix, unmask) - + + if not test_schema: + gen_examples(schema, output_dir, prefix) def main() -> int: """