From patchwork Wed Jul 6 09:13:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 9215857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2488C60752 for ; Wed, 6 Jul 2016 09:15:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 123EA287B3 for ; Wed, 6 Jul 2016 09:15:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 050F6287B5; Wed, 6 Jul 2016 09:15:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 600A3287B3 for ; Wed, 6 Jul 2016 09:15:40 +0000 (UTC) Received: from localhost ([::1]:60386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKivj-0007og-92 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Jul 2016 05:15:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKiuL-00072r-Cd for qemu-devel@nongnu.org; Wed, 06 Jul 2016 05:14:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKiuH-0000QO-PL for qemu-devel@nongnu.org; Wed, 06 Jul 2016 05:14:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKiuH-0000QA-H8 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 05:14:09 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 33045461E2 for ; Wed, 6 Jul 2016 09:14:09 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-37.ams2.redhat.com [10.36.116.37]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u669E645024744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 Jul 2016 05:14:08 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 73F571133028; Wed, 6 Jul 2016 11:14:06 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 6 Jul 2016 11:13:52 +0200 Message-Id: <1467796446-25446-2-git-send-email-armbru@redhat.com> In-Reply-To: <1467796446-25446-1-git-send-email-armbru@redhat.com> References: <1467796446-25446-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 06 Jul 2016 09:14:09 +0000 (UTC) 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] [PULL 01/15] qapi: Improve use of qmp/types.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Blake 'qjson.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 Message-Id: <1465490926-28625-2-git-send-email-eblake@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- 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/qjson.c | 6 +----- qobject/qobject.c | 7 +------ tests/check-qjson.c | 8 +------- 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(+), 30 deletions(-) diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c index e2d4e68..048ce6a 100644 --- a/hw/pci/pcie_aer.c +++ b/hw/pci/pcie_aer.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "sysemu/sysemu.h" #include "qapi/qmp/types.h" +#include "qapi/qmp/qjson.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 7782ec5..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/qjson.h" #endif /* QEMU_OBJECTS_H */ diff --git a/monitor.c b/monitor.c index 6f960f1..ed09cdc 100644 --- a/monitor.c +++ b/monitor.c @@ -54,11 +54,7 @@ #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/types.h" #include "qapi/qmp/qjson.h" #include "qapi/qmp/json-streamer.h" #include "qapi/qmp/json-parser.h" diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 08faf85..505eb41 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -16,6 +16,7 @@ #include "qapi/qmp/types.h" #include "qapi/qmp/dispatch.h" #include "qapi/qmp/json-parser.h" +#include "qapi/qmp/qjson.h" #include "qapi-types.h" #include "qapi/qmp/qerror.h" diff --git a/qobject/json-parser.c b/qobject/json-parser.c index 67ed727..c18e48a 100644 --- a/qobject/json-parser.c +++ b/qobject/json-parser.c @@ -14,12 +14,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #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/qjson.c b/qobject/qjson.c index ef160d2..9a0de89 100644 --- a/qobject/qjson.c +++ b/qobject/qjson.c @@ -16,11 +16,7 @@ #include "qapi/qmp/json-parser.h" #include "qapi/qmp/json-streamer.h" #include "qapi/qmp/qjson.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" #include "qemu/unicode.h" typedef struct JSONParsingState diff --git a/qobject/qobject.c b/qobject/qobject.c index cd41fb9..fe4fa10 100644 --- a/qobject/qobject.c +++ b/qobject/qobject.c @@ -9,12 +9,7 @@ #include "qemu/osdep.h" #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-qjson.c b/tests/check-qjson.c index 0e158f6..8595574 100644 --- a/tests/check-qjson.c +++ b/tests/check-qjson.c @@ -12,14 +12,8 @@ */ #include "qemu/osdep.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/qjson.h" - #include "qemu-common.h" static void escaped_string(void) diff --git a/tests/test-qmp-input-strict.c b/tests/test-qmp-input-strict.c index d5f57c5..79739e9 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/qjson.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 1a4585c..17cda5a 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/qjson.h" typedef struct TestInputVisitorData { QObject *obj; diff --git a/tests/test-qmp-output-visitor.c b/tests/test-qmp-output-visitor.c index f8a7a27..e030c67 100644 --- a/tests/test-qmp-output-visitor.c +++ b/tests/test-qmp-output-visitor.c @@ -18,6 +18,7 @@ #include "test-qapi-types.h" #include "test-qapi-visit.h" #include "qapi/qmp/types.h" +#include "qapi/qmp/qjson.h" typedef struct TestOutputVisitorData { QmpOutputVisitor *qov; diff --git a/tests/test-visitor-serialization.c b/tests/test-visitor-serialization.c index 777469f..db781c0 100644 --- a/tests/test-visitor-serialization.c +++ b/tests/test-visitor-serialization.c @@ -19,6 +19,7 @@ #include "test-qapi-visit.h" #include "qapi/error.h" #include "qapi/qmp/types.h" +#include "qapi/qmp/qjson.h" #include "qapi/qmp-input-visitor.h" #include "qapi/qmp-output-visitor.h" #include "qapi/string-input-visitor.h"