From nobody Tue Feb 10 04:03:09 2026 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=1565587508; cv=none; d=zoho.com; s=zohoarc; b=S+bjpVi7k6vVTgeSHh0SbnZtUcx+0Ky4cmv4L6PtHIvkvVEdj91S15RmuigaqrgxgI23EkDmm7xbt3F5dazXAVu+1StwSy+CUyRwXKD1QbiuIM6Nb56FrBpw3W1fhUlWCboxX9qDZ0Mv9j21Ulg3aPd1PDrgam3qsBz4XQtuBhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565587508; h=Content-Type: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:ARC-Authentication-Results; bh=7UAvGiE2rUqGTJ6ruwaYqhA7hoeFRgumgOAGZwo4s5k=; b=AyrtP/36xBjd+re7p40U2hi2s1wvUo3hX7bx8o+52euks9hblijkvFXW/IG6uS9DRrFVoL7UADzkehGvu4tYrvDixr37bRGqNzctqYH45M4laDmWCd/AUCvsfQ4p3dVdh5X9jy/bKcYLdUzeLLR4SKlVABB+Id4hYJRuI2wCWhs= 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 1565587508093764.8655015938253; Sun, 11 Aug 2019 22:25:08 -0700 (PDT) Received: from localhost ([::1]:42934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hx2pH-0001zS-4o for importer@patchew.org; Mon, 12 Aug 2019 01:24:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57074) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hx2oQ-0008W3-U7 for qemu-devel@nongnu.org; Mon, 12 Aug 2019 01:24:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hx2oP-00063D-Iz for qemu-devel@nongnu.org; Mon, 12 Aug 2019 01:24:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60838) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hx2oP-00061r-Ac for qemu-devel@nongnu.org; Mon, 12 Aug 2019 01:24:05 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2DF0C806D2 for ; Mon, 12 Aug 2019 05:24:04 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-117-142.ams2.redhat.com [10.36.117.142]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 730B5196BA; Mon, 12 Aug 2019 05:24:01 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C6B2D113860E; Mon, 12 Aug 2019 07:23:59 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 12 Aug 2019 07:23:33 +0200 Message-Id: <20190812052359.30071-4-armbru@redhat.com> In-Reply-To: <20190812052359.30071-1-armbru@redhat.com> References: <20190812052359.30071-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 12 Aug 2019 05:24:04 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 03/29] qapi: Split error.json off common.json 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" In my "build everything" tree, changing a type in qapi/common.json triggers a recompile of some 3600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). One common dependency is QapiErrorClass: it's used only in in qapi/error.h, which uses nothing else, and is widely included. Move QapiErrorClass from common.json to new error.json. Touching common.json now recompiles only some 2900 objects. Cc: Eric Blake Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- qapi/common.json | 24 ------------------------ qapi/error.json | 29 +++++++++++++++++++++++++++++ qapi/qapi-schema.json | 1 + include/qapi/error.h | 2 +- MAINTAINERS | 2 ++ qapi/Makefile.objs | 2 +- 6 files changed, 34 insertions(+), 26 deletions(-) create mode 100644 qapi/error.json diff --git a/qapi/common.json b/qapi/common.json index 99d313ef3b..3d4e8de1e0 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -4,30 +4,6 @@ # =3D Common data types ## =20 -## -# @QapiErrorClass: -# -# QEMU error classes -# -# @GenericError: this is used for errors that don't require a specific err= or -# class. This should be the default case for most errors -# -# @CommandNotFound: the requested command has not been found -# -# @DeviceNotActive: a device has failed to be become active -# -# @DeviceNotFound: the requested device has not been found -# -# @KVMMissingCap: the requested operation can't be fulfilled because a -# required KVM capability is missing -# -# Since: 1.2 -## -{ 'enum': 'QapiErrorClass', - # Keep this in sync with ErrorClass in error.h - 'data': [ 'GenericError', 'CommandNotFound', - 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] } - ## # @IoOperationType: # diff --git a/qapi/error.json b/qapi/error.json new file mode 100644 index 0000000000..3fad08f506 --- /dev/null +++ b/qapi/error.json @@ -0,0 +1,29 @@ +# -*- Mode: Python -*- + +## +# =3D QMP errors +## + +## +# @QapiErrorClass: +# +# QEMU error classes +# +# @GenericError: this is used for errors that don't require a specific err= or +# class. This should be the default case for most errors +# +# @CommandNotFound: the requested command has not been found +# +# @DeviceNotActive: a device has failed to be become active +# +# @DeviceNotFound: the requested device has not been found +# +# @KVMMissingCap: the requested operation can't be fulfilled because a +# required KVM capability is missing +# +# Since: 1.2 +## +{ 'enum': 'QapiErrorClass', + # Keep this in sync with ErrorClass in error.h + 'data': [ 'GenericError', 'CommandNotFound', + 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] } diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index 38af54d6b3..920b03b0aa 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -80,6 +80,7 @@ # stable order, it's best to include each sub-schema just once, or # include it first right here. =20 +{ 'include': 'error.json' } { 'include': 'common.json' } { 'include': 'sockets.json' } { 'include': 'run-state.json' } diff --git a/include/qapi/error.h b/include/qapi/error.h index 51b63dd4b5..3f95141a01 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -119,7 +119,7 @@ #ifndef ERROR_H #define ERROR_H =20 -#include "qapi/qapi-types-common.h" +#include "qapi/qapi-types-error.h" =20 /* * Overall category of an error. diff --git a/MAINTAINERS b/MAINTAINERS index d6de200453..adc64cfe33 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1874,6 +1874,7 @@ M: Markus Armbruster S: Supported F: include/qapi/error.h F: include/qemu/error-report.h +F: qapi/error.json F: util/error.c F: util/qemu-error.c =20 @@ -2062,6 +2063,7 @@ F: monitor/monitor-internal.h F: monitor/qmp* F: monitor/misc.c F: monitor/monitor.c +F: qapi/error.json F: docs/devel/*qmp-* F: docs/interop/*qmp-* F: scripts/qmp/ diff --git a/qapi/Makefile.objs b/qapi/Makefile.objs index c5a29e86e2..dd3f5e6f94 100644 --- a/qapi/Makefile.objs +++ b/qapi/Makefile.objs @@ -6,7 +6,7 @@ util-obj-y +=3D qmp-event.o util-obj-y +=3D qapi-util.o =20 QAPI_COMMON_MODULES =3D audio authz block-core block char common crypto -QAPI_COMMON_MODULES +=3D dump introspect job machine migration misc net +QAPI_COMMON_MODULES +=3D dump error introspect job machine migration misc = net QAPI_COMMON_MODULES +=3D qdev qom rdma rocker run-state sockets tpm QAPI_COMMON_MODULES +=3D trace transaction ui QAPI_TARGET_MODULES =3D machine-target misc-target --=20 2.21.0