From nobody Mon Nov 25 09:39:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1715926382; cv=none; d=zohomail.com; s=zohoarc; b=U4MVw6KWk8NGqaxUWpMfVhEFOagrHtMJF4/uVsp734NgtcYmN3OD2bLA+YqkbpHajAg+iP8kfNQh6Rj87md9wZZyzO/9cMr/gy6+gNMzy1w1N7pcjMv65kLd4+Hw9y5VfDg4G6Tx3kLI+hhuPoNoTMoeNsWyXYgeJOb0JxoySzU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715926382; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hp9w2mK7QczDuZZRuqBjjAbsSL6SqfN6OdUNRzPbC3s=; b=X7UD4bmSQa9GD77RqLF+DufNHKnXnBGM7/pvYmiBZfl+lRHdYw6bToh5ejH9ipLUGdfWn7agrksbdfpCvDUTuNCx3APr5MhM3vm8GCurZRGnOP6uZMhrZ58h+OMYJ6iiLqSYtOyIXuYNmxhLbGAD/m8VdjPLNPKheCQHRuZYsmw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1715926382347900.1678847782839; Thu, 16 May 2024 23:13:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7qpn-0004Cd-CU; Fri, 17 May 2024 02:12:52 -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 1s7qpj-00048V-85 for qemu-devel@nongnu.org; Fri, 17 May 2024 02:12:47 -0400 Received: from mgamail.intel.com ([198.175.65.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s7qpb-0002oD-IV for qemu-devel@nongnu.org; Fri, 17 May 2024 02:12:46 -0400 Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2024 23:12:35 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by fmviesa007.fm.intel.com with ESMTP; 16 May 2024 23:12:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715926359; x=1747462359; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ThiBVBuJSiLAGHZSgNXK0nWPd2pkS4T7DVvbx25AFcw=; b=gvckxfouBKbwu9nPO7uj77K2eR/FfeEoaD7iyT/NUDs/tLYIkcEZbizm jwP/cNuZkD2QW0zd4F35/KPK7yV6jo15U+eXbgtorGqHjU2SN1lOHfJui czbDrYaoIKiI5eTuQkVVY3sTKSEX/bWOfJTrS3uZv1vptjtE991twnZPg bGznrA0F0SlEePKmw4w6Q5yVlbJH0FCcmlGoESHFQQ35mNyOD6ynHU4RJ qU/tNPSXNXArd7sF4rC7ZtUpzTL6KCLDf0KdyllthKaLlpljzLqFOaGj4 HupKI/JayyTgONKCA+deL19ojWQeNYkIBfKK9IUVEgCE/34jGelFV7jst g==; X-CSE-ConnectionGUID: 2/0JaSW1RcOWAuJMVv2JzA== X-CSE-MsgGUID: 0F0QWGHUS1aG/1TsFDHSuA== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="15869074" X-IronPort-AV: E=Sophos;i="6.08,166,1712646000"; d="scan'208";a="15869074" X-CSE-ConnectionGUID: X2ZVh/I3TF64hzZd6W3X8g== X-CSE-MsgGUID: f0nuc8dCSYSZHwBPKiUbkg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,166,1712646000"; d="scan'208";a="31620648" From: Zhao Liu To: Eric Blake , Markus Armbruster Cc: qemu-devel@nongnu.org, Zhao Liu Subject: [PATCH 1/2] qapi: Reorder and categorize json files in qapi-schema.json Date: Fri, 17 May 2024 14:27:47 +0800 Message-Id: <20240517062748.782366-2-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240517062748.782366-1-zhao1.liu@intel.com> References: <20240517062748.782366-1-zhao1.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=198.175.65.15; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.022, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1715926382881100001 Content-Type: text/plain; charset="utf-8" Currently, the C code is generated sequentially in the order of the QAPI json files in qapi-schema.json. This requires that the included file must be listed first, before the file that includes it. The current files' order implicitly fulfills this requirement, but unclear dependency relationship makes it unfriendly for subsequent dependency handling/adding new files. While dependencies can be better handled by adding a sorting algorithm to scripts/qapi/gen.py, to simplify and visualize the current API JSON dependencies, sort them manually and categorize by dependency hierarchy. Based on this, the new files should be placed in the corresponding sections according to the dependencies/dependency hierarchy. Signed-off-by: Zhao Liu --- qapi/qapi-schema.json | 100 +++++++++++++++++++++++++++++------------- 1 file changed, 69 insertions(+), 31 deletions(-) diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index 5e33da7228f2..57ea6bcb33e9 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -38,45 +38,83 @@ =20 # Documentation generated with qapi-gen.py is in source order, with # included sub-schemas inserted at the first include directive -# (subsequent include directives have no effect). To get a sane and -# stable order, it's best to include each sub-schema just once, or -# include it first right here. +# (subsequent include directives have no effect). Please place the +# file correctly in the following sections according to the +# dependencies. +# +# To get a sane and stable order, it's best to include each sub-schema +# just once, or include it first right here. =20 -{ 'include': 'error.json' } +# Section 1. Files without dependencies. + +{ 'include': 'acpi.json' } +{ 'include': 'audio.json' } +{ 'include': 'authz.json' } { 'include': 'common.json' } -{ 'include': 'sockets.json' } -{ 'include': 'run-state.json' } +{ 'include': 'compat.json' } +{ 'include': 'control.json' } { 'include': 'crypto.json' } -{ 'include': 'job.json' } -{ 'include': 'block.json' } -{ 'include': 'block-export.json' } -{ 'include': 'char.json' } +{ 'include': 'cryptodev.json' } +{ 'include': 'cxl.json' } { 'include': 'dump.json' } -{ 'include': 'net.json' } { 'include': 'ebpf.json' } -{ 'include': 'rocker.json' } -{ 'include': 'tpm.json' } -{ 'include': 'ui.json' } -{ 'include': 'authz.json' } -{ 'include': 'migration.json' } -{ 'include': 'transaction.json' } -{ 'include': 'trace.json' } -{ 'include': 'compat.json' } -{ 'include': 'control.json' } +{ 'include': 'error.json' } { 'include': 'introspect.json' } -{ 'include': 'qom.json' } -{ 'include': 'qdev.json' } +{ 'include': 'job.json' } { 'include': 'machine-common.json' } -{ 'include': 'machine.json' } -{ 'include': 'machine-target.json' } -{ 'include': 'replay.json' } -{ 'include': 'yank.json' } -{ 'include': 'misc.json' } { 'include': 'misc-target.json' } -{ 'include': 'audio.json' } -{ 'include': 'acpi.json' } { 'include': 'pci.json' } +{ 'include': 'rocker.json' } +{ 'include': 'run-state.json' } +{ 'include': 'sockets.json' } { 'include': 'stats.json' } +{ 'include': 'tpm.json' } +{ 'include': 'trace.json' } { 'include': 'virtio.json' } -{ 'include': 'cryptodev.json' } -{ 'include': 'cxl.json' } +{ 'include': 'yank.json' } + +# Section 2. Files with 1-level dependencies. +# +# All their dependencies are listed in the section 1. + +# include sockets.json +{ 'include': 'char.json' } +# include machine-common.json +{ 'include': 'machine-target.json' } +# include common.json, machine-common.json +{ 'include': 'machine.json' } +# include common.json, sockets.json +{ 'include': 'migration.json' } +# include common.json +{ 'include': 'misc.json' } +# include sockets.json +{ 'include': 'net.json' } +# include common.json +{ 'include': 'replay.json' } +# include common.json, sockets.json +{ 'include': 'ui.json' } + +# Section 3. Files with 2-level dependencies. +# +# Their dependencies are either listed in the previous sections, or are +# not listed but include files from the previous section. At least one +# dependency is a 1-level dependency file. + +# include sockets.json (section 1), block-core.json (not listed, 1-level +# dependencies) +{ 'include': 'block-export.json' } +# include block-core.json (not listed, 1-level dependencies) +{ 'include': 'block.json' } +# include authz.json (section 1), common.json (section 1), crypto.json +# (section 1), block-core.json (not listed, 1-level dependencies) +{ 'include': 'qom.json' } +# include block-core.json (not listed, 1-level dependencies) +{ 'include': 'transaction.json' } + +# Section 4. Files with 3-level dependencies. +# +# All their dependencies are listed in the previous sections. At least one +# dependency is from section 3. + +# include qom.json (section 3) +{ 'include': 'qdev.json' } --=20 2.34.1 From nobody Mon Nov 25 09:39:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1715926382; cv=none; d=zohomail.com; s=zohoarc; b=CmGM2I9jg7oukR1qyIahMdYLjbgxWanTQBH8evSVyGLtBHbq6IHs8mJ6Nr4aOXGQvBnY0l8N1z1c2m0y6AhozxAo0eJCgyQNwWO8ONjXJ5d9SByCp1mU/b10rHgzkZilQTI5m4oLEn3FGN7L/gYPIGGZKwAQtlVYFUi9BNyrIlE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715926382; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/myic7aal3G8zB+vJzVNSoXve4hDFhBooi9BrGsDZ2o=; b=Tr3yyzjooQTvvzXOzfQjzDI/zHff+0OGOYJJhbBlzY7u+EOrRO1Rb8BNByFoBN2OkKVv0L59SSBcyKkax9Ihzp8bVgy6ZnActww7Zg8b84THnUpU/JXX9RkQToBOYS5p3wMEcbZ+qBj0LSnoChPr88KfsjFeRtXqXCS9/EiC0Tw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1715926382876783.4374072605466; Thu, 16 May 2024 23:13:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7qpm-0004BS-9E; Fri, 17 May 2024 02:12:50 -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 1s7qpj-00048Z-80 for qemu-devel@nongnu.org; Fri, 17 May 2024 02:12:47 -0400 Received: from mgamail.intel.com ([198.175.65.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s7qpb-0002om-IP for qemu-devel@nongnu.org; Fri, 17 May 2024 02:12:46 -0400 Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2024 23:12:36 -0700 Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by fmviesa007.fm.intel.com with ESMTP; 16 May 2024 23:12:35 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715926359; x=1747462359; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/D5KL9gsn1w1Kjzhi/6jGBTDPW6/izNdWX+gtGUBd3E=; b=nLR0xVBwPDOPyzpKvTDGcCU3Z7knHMxsbNlvn8cgAsPo+QZF8kRqRt73 U20kQmUL1BbypsGJs7b2s4YW33ceYNvJAV4e22UxtoaE0t9ZPWsEW/k74 QgS76Jjo6WD9z3Zj6exjvBGJVXYY75+RmssFjlih6oUL0yzP/FhHelMva /6dQ9BVNd9o6FVjlDwMdJdqhJKCicinN1rld3Fur+FCmtK2RFjSYiJ/Gn YFB8m8gbbF4eOfj4LR5zNQWATVJKMsMgs3hBrHIRuuL+yfIkt+1q3ukK7 mVY9dvqxMv3OG+QntyNz0CHatLpCfH9KGBDJxHaeMLzW/5nuQI6MHBOKs A==; X-CSE-ConnectionGUID: 8lT/i5YSRBaYFMNeDmLw3g== X-CSE-MsgGUID: NA+Cg3ShQs6Kz2FWU0WMIg== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="15869080" X-IronPort-AV: E=Sophos;i="6.08,166,1712646000"; d="scan'208";a="15869080" X-CSE-ConnectionGUID: WS8vR0YrSlGCvXLgZcR1jg== X-CSE-MsgGUID: vBOD7RywSmyWxyEzBtw9ew== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,166,1712646000"; d="scan'208";a="31620653" From: Zhao Liu To: Eric Blake , Markus Armbruster Cc: qemu-devel@nongnu.org, Zhao Liu Subject: [PATCH 2/2] qapi: List block-core.json in qapi-schema.json Date: Fri, 17 May 2024 14:27:48 +0800 Message-Id: <20240517062748.782366-3-zhao1.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240517062748.782366-1-zhao1.liu@intel.com> References: <20240517062748.782366-1-zhao1.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=198.175.65.15; envelope-from=zhao1.liu@intel.com; helo=mgamail.intel.com X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.022, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1715926384874100007 Content-Type: text/plain; charset="utf-8" Currently, block-core.json is not explicitly listed in the qapi-schema.json. To make the dependencies clearer, list block-core.json in section 2. Signed-off-by: Zhao Liu --- qapi/qapi-schema.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index 57ea6bcb33e9..14196128c44e 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -77,6 +77,8 @@ # # All their dependencies are listed in the section 1. =20 +# include common.json, crypto.json, job.json, sockets.json +{ 'include': 'block-core.json' } # include sockets.json { 'include': 'char.json' } # include machine-common.json @@ -96,19 +98,17 @@ =20 # Section 3. Files with 2-level dependencies. # -# Their dependencies are either listed in the previous sections, or are -# not listed but include files from the previous section. At least one -# dependency is a 1-level dependency file. +# All their dependencies are listed in the previous sections. At least one +# dependency is from section 2. =20 -# include sockets.json (section 1), block-core.json (not listed, 1-level -# dependencies) +# include sockets.json (section 1), block-core.json (section 2) { 'include': 'block-export.json' } -# include block-core.json (not listed, 1-level dependencies) +# include block-core.json (section 2) { 'include': 'block.json' } # include authz.json (section 1), common.json (section 1), crypto.json -# (section 1), block-core.json (not listed, 1-level dependencies) +# (section 1), block-core.json (section 2) { 'include': 'qom.json' } -# include block-core.json (not listed, 1-level dependencies) +# include block-core.json (section 2) { 'include': 'transaction.json' } =20 # Section 4. Files with 3-level dependencies. --=20 2.34.1