From patchwork Tue Dec 22 00:30:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 559829 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8AC1D14029E for ; Tue, 22 Dec 2015 11:33:39 +1100 (AEDT) Received: from localhost ([::1]:47969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBAtV-0004z0-CQ for incoming@patchwork.ozlabs.org; Mon, 21 Dec 2015 19:33:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBArI-0000OP-0Q for qemu-devel@nongnu.org; Mon, 21 Dec 2015 19:31:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBArG-00023V-K2 for qemu-devel@nongnu.org; Mon, 21 Dec 2015 19:31:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBArG-00023L-CJ for qemu-devel@nongnu.org; Mon, 21 Dec 2015 19:31:18 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id EAAC78F266; Tue, 22 Dec 2015 00:31:17 +0000 (UTC) Received: from red.redhat.com (ovpn-113-191.phx2.redhat.com [10.3.113.191]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBM0VAd9007036; Mon, 21 Dec 2015 19:31:17 -0500 From: Eric Blake To: qemu-devel@nongnu.org Date: Mon, 21 Dec 2015 17:30:56 -0700 Message-Id: <1450744268-25052-3-git-send-email-eblake@redhat.com> In-Reply-To: <1450744268-25052-1-git-send-email-eblake@redhat.com> References: <1450744268-25052-1-git-send-email-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Michael Roth , pbonzini@redhat.com, Luiz Capitulino , armbru@redhat.com, "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH v2 02/14] qapi: Improve use of qmp/types.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 'qobject-json.h' is not a QObject subtype; include this file directly in .c files that are using it, rather than abusing qmp/types.h for that purpose. Meanwhile, for files that include a list of individual QObject subtypes, it's easier to just use qmp/types.h for that purpose. Signed-off-by: Eric Blake Reviewed-by: Fam Zheng --- v2: no change --- hw/pci/pcie_aer.c | 1 + include/qapi/qmp/types.h | 1 - monitor.c | 6 +----- qapi/qmp-dispatch.c | 1 + qobject/json-parser.c | 7 +------ qobject/qobject-json.c | 6 +----- qobject/qobject.c | 7 +------ tests/check-qobject-json.c | 7 +------ tests/test-qmp-input-strict.c | 1 + tests/test-qmp-input-visitor.c | 1 + tests/test-qmp-output-visitor.c | 1 + tests/test-visitor-serialization.c | 1 + 12 files changed, 11 insertions(+), 29 deletions(-) diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c index 98d2c18..dd5588c 100644 --- a/hw/pci/pcie_aer.c +++ b/hw/pci/pcie_aer.c @@ -20,6 +20,7 @@ #include "sysemu/sysemu.h" #include "qapi/qmp/types.h" +#include "qapi/qmp/qobject-json.h" #include "monitor/monitor.h" #include "hw/pci/pci_bridge.h" #include "hw/pci/pcie.h" diff --git a/include/qapi/qmp/types.h b/include/qapi/qmp/types.h index 9109eda..f21ecf4 100644 --- a/include/qapi/qmp/types.h +++ b/include/qapi/qmp/types.h @@ -20,6 +20,5 @@ #include "qapi/qmp/qstring.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" -#include "qapi/qmp/qobject-json.h" #endif /* QEMU_OBJECTS_H */ diff --git a/monitor.c b/monitor.c index 1dfd359..ed6a548 100644 --- a/monitor.c +++ b/monitor.c @@ -50,12 +50,8 @@ #include "qemu/acl.h" #include "sysemu/tpm.h" #include "qapi/qmp/qerror.h" -#include "qapi/qmp/qint.h" -#include "qapi/qmp/qfloat.h" -#include "qapi/qmp/qlist.h" -#include "qapi/qmp/qbool.h" -#include "qapi/qmp/qstring.h" #include "qapi/qmp/qobject-json.h" +#include "qapi/qmp/types.h" #include "qapi/qmp/json-streamer.h" #include "qapi/qmp/json-parser.h" #include diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index f36933d..4b79bf4 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -14,6 +14,7 @@ #include "qapi/qmp/types.h" #include "qapi/qmp/dispatch.h" #include "qapi/qmp/json-parser.h" +#include "qapi/qmp/qobject-json.h" #include "qapi-types.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" diff --git a/qobject/json-parser.c b/qobject/json-parser.c index 6ab98a7..441c6e9 100644 --- a/qobject/json-parser.c +++ b/qobject/json-parser.c @@ -14,12 +14,7 @@ #include #include "qemu-common.h" -#include "qapi/qmp/qstring.h" -#include "qapi/qmp/qint.h" -#include "qapi/qmp/qdict.h" -#include "qapi/qmp/qlist.h" -#include "qapi/qmp/qfloat.h" -#include "qapi/qmp/qbool.h" +#include "qapi/qmp/types.h" #include "qapi/qmp/json-parser.h" #include "qapi/qmp/json-lexer.h" #include "qapi/qmp/json-streamer.h" diff --git a/qobject/qobject-json.c b/qobject/qobject-json.c index 8fc65a4..cc96ff6 100644 --- a/qobject/qobject-json.c +++ b/qobject/qobject-json.c @@ -15,11 +15,7 @@ #include "qapi/qmp/json-parser.h" #include "qapi/qmp/json-streamer.h" #include "qapi/qmp/qobject-json.h" -#include "qapi/qmp/qint.h" -#include "qapi/qmp/qlist.h" -#include "qapi/qmp/qbool.h" -#include "qapi/qmp/qfloat.h" -#include "qapi/qmp/qdict.h" +#include "qapi/qmp/types.h" typedef struct JSONParsingState { diff --git a/qobject/qobject.c b/qobject/qobject.c index a3ef14e..0c468d8 100644 --- a/qobject/qobject.c +++ b/qobject/qobject.c @@ -8,12 +8,7 @@ */ #include "qemu-common.h" -#include "qapi/qmp/qbool.h" -#include "qapi/qmp/qdict.h" -#include "qapi/qmp/qfloat.h" -#include "qapi/qmp/qint.h" -#include "qapi/qmp/qlist.h" -#include "qapi/qmp/qstring.h" +#include "qapi/qmp/types.h" static void (*qdestroy[QTYPE__MAX])(QObject *) = { [QTYPE_NONE] = NULL, /* No such object exists */ diff --git a/tests/check-qobject-json.c b/tests/check-qobject-json.c index 9c4e53a..46d4edf 100644 --- a/tests/check-qobject-json.c +++ b/tests/check-qobject-json.c @@ -12,12 +12,7 @@ */ #include -#include "qapi/qmp/qstring.h" -#include "qapi/qmp/qint.h" -#include "qapi/qmp/qdict.h" -#include "qapi/qmp/qlist.h" -#include "qapi/qmp/qfloat.h" -#include "qapi/qmp/qbool.h" +#include "qapi/qmp/types.h" #include "qapi/qmp/qobject-json.h" #include "qemu-common.h" diff --git a/tests/test-qmp-input-strict.c b/tests/test-qmp-input-strict.c index 4db35dd..b929ec7 100644 --- a/tests/test-qmp-input-strict.c +++ b/tests/test-qmp-input-strict.c @@ -19,6 +19,7 @@ #include "test-qapi-types.h" #include "test-qapi-visit.h" #include "qapi/qmp/types.h" +#include "qapi/qmp/qobject-json.h" #include "test-qmp-introspect.h" #include "qmp-introspect.h" #include "qapi-visit.h" diff --git a/tests/test-qmp-input-visitor.c b/tests/test-qmp-input-visitor.c index 7f9191c..5e30fd8 100644 --- a/tests/test-qmp-input-visitor.c +++ b/tests/test-qmp-input-visitor.c @@ -18,6 +18,7 @@ #include "test-qapi-types.h" #include "test-qapi-visit.h" #include "qapi/qmp/types.h" +#include "qapi/qmp/qobject-json.h" typedef struct TestInputVisitorData { QObject *obj; diff --git a/tests/test-qmp-output-visitor.c b/tests/test-qmp-output-visitor.c index 74d0ac4..f1171e6 100644 --- a/tests/test-qmp-output-visitor.c +++ b/tests/test-qmp-output-visitor.c @@ -17,6 +17,7 @@ #include "test-qapi-types.h" #include "test-qapi-visit.h" #include "qapi/qmp/types.h" +#include "qapi/qmp/qobject-json.h" typedef struct TestOutputVisitorData { QmpOutputVisitor *qov; diff --git a/tests/test-visitor-serialization.c b/tests/test-visitor-serialization.c index f74a6df..381e188 100644 --- a/tests/test-visitor-serialization.c +++ b/tests/test-visitor-serialization.c @@ -20,6 +20,7 @@ #include "test-qapi-types.h" #include "test-qapi-visit.h" #include "qapi/qmp/types.h" +#include "qapi/qmp/qobject-json.h" #include "qapi/qmp-input-visitor.h" #include "qapi/qmp-output-visitor.h" #include "qapi/string-input-visitor.h"