From patchwork Fri Apr 29 04:23:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 8977011 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 51D58BF29F for ; Fri, 29 Apr 2016 04:26:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 123DC20219 for ; Fri, 29 Apr 2016 04:26:32 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id A620B201C0 for ; Fri, 29 Apr 2016 04:26:30 +0000 (UTC) Received: from localhost ([::1]:52217 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw00b-0003cm-TI for patchwork-qemu-devel@patchwork.kernel.org; Fri, 29 Apr 2016 00:26:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avzy5-0007Ft-CP for qemu-devel@nongnu.org; Fri, 29 Apr 2016 00:23:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avzy3-0000tM-Gr for qemu-devel@nongnu.org; Fri, 29 Apr 2016 00:23:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avzxz-0000r8-9I; Fri, 29 Apr 2016 00:23:47 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 8FAB5E77D1; Fri, 29 Apr 2016 04:23:46 +0000 (UTC) Received: from red.redhat.com (ovpn-113-21.phx2.redhat.com [10.3.113.21]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3T4Ngew016324; Fri, 29 Apr 2016 00:23:43 -0400 From: Eric Blake To: qemu-devel@nongnu.org Date: Thu, 28 Apr 2016 22:23:22 -0600 Message-Id: <1461903820-3092-2-git-send-email-eblake@redhat.com> In-Reply-To: <1461903820-3092-1-git-send-email-eblake@redhat.com> References: <1461903820-3092-1-git-send-email-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 29 Apr 2016 04:23:46 +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] [PATCH v3 01/18] qapi: Rename (one) qjson.h to qobject-json.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: , Cc: Kevin Wolf , Alexander Graf , "open list:Block layer core" , famz@redhat.com, Michael Roth , Chrysostomos Nanakos , "Michael S. Tsirkin" , Jeff Cody , armbru@redhat.com, Christian Borntraeger , Max Reitz , Alberto Garcia , Gerd Hoffmann , "open list:Overall" , Cornelia Huck , Paolo Bonzini , Luiz Capitulino , Jason Wang , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We have two different JSON visitors in the tree; and having both named 'qjson.h' can cause include confusion. Rename the qapi version. Why did I pick that one? A later patch plans on deleting the top-level qjson.c once we have a native JSON output visitor; we could have renamed that one for less overall churn. On the other hand, all of the QObject subtypes have their own qFOO.c file, but qjson.c makes it sound like we have a QTYPE_JSON subclass of QObject; the new name of qobject-json makes it obvious that the file is used for conversions between QObject and JSON, and not a QObject subtype. Kill trailing whitespace in the renamed tests/check-qobject-json.c to keep checkpatch.pl happy. Signed-off-by: Eric Blake Reviewed-by: Paolo Bonzini --- v3: rebase to master v2: retitle, enhance commit message, rebase to master --- include/qapi/qmp/{qjson.h => qobject-json.h} | 0 include/qapi/qmp/types.h | 2 +- balloon.c | 2 +- block.c | 2 +- block/archipelago.c | 2 +- block/nbd.c | 2 +- block/quorum.c | 2 +- blockjob.c | 2 +- hw/core/qdev.c | 2 +- hw/misc/pvpanic.c | 2 +- hw/net/virtio-net.c | 2 +- monitor.c | 2 +- qapi/qmp-event.c | 2 +- qemu-img.c | 2 +- qga/main.c | 2 +- qobject/{qjson.c => qobject-json.c} | 2 +- target-s390x/kvm.c | 2 +- tests/{check-qjson.c => check-qobject-json.c} | 14 +++++++------- tests/libqtest.c | 2 +- ui/spice-core.c | 2 +- vl.c | 2 +- MAINTAINERS | 2 +- qobject/Makefile.objs | 3 ++- tests/.gitignore | 2 +- tests/Makefile | 8 ++++---- 25 files changed, 34 insertions(+), 33 deletions(-) rename include/qapi/qmp/{qjson.h => qobject-json.h} (100%) rename qobject/{qjson.c => qobject-json.c} (99%) rename tests/{check-qjson.c => check-qobject-json.c} (99%) diff --git a/include/qapi/qmp/qjson.h b/include/qapi/qmp/qobject-json.h similarity index 100% rename from include/qapi/qmp/qjson.h rename to include/qapi/qmp/qobject-json.h diff --git a/include/qapi/qmp/types.h b/include/qapi/qmp/types.h index 7782ec5..9109eda 100644 --- a/include/qapi/qmp/types.h +++ b/include/qapi/qmp/types.h @@ -20,6 +20,6 @@ #include "qapi/qmp/qstring.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qlist.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #endif /* QEMU_OBJECTS_H */ diff --git a/balloon.c b/balloon.c index f2ef50c..2a11689 100644 --- a/balloon.c +++ b/balloon.c @@ -32,7 +32,7 @@ #include "trace.h" #include "qmp-commands.h" #include "qapi/qmp/qerror.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" static QEMUBalloonEvent *balloon_event_fn; static QEMUBalloonStatus *balloon_stat_fn; diff --git a/block.c b/block.c index d4939b4..6e86863 100644 --- a/block.c +++ b/block.c @@ -29,7 +29,7 @@ #include "qemu/module.h" #include "qapi/qmp/qerror.h" #include "qapi/qmp/qbool.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "sysemu/block-backend.h" #include "sysemu/sysemu.h" #include "qemu/notify.h" diff --git a/block/archipelago.c b/block/archipelago.c index b9f5e69..104f2f9 100644 --- a/block/archipelago.c +++ b/block/archipelago.c @@ -57,7 +57,7 @@ #include "qemu/thread.h" #include "qapi/qmp/qint.h" #include "qapi/qmp/qstring.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qemu/atomic.h" #include diff --git a/block/nbd.c b/block/nbd.c index f7ea3b3..d8899c4 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -33,7 +33,7 @@ #include "block/block_int.h" #include "qemu/module.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qapi/qmp/qint.h" #include "qapi/qmp/qstring.h" #include "qemu/cutils.h" diff --git a/block/quorum.c b/block/quorum.c index da15465..a0a053a 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -19,7 +19,7 @@ #include "qapi/qmp/qdict.h" #include "qapi/qmp/qerror.h" #include "qapi/qmp/qint.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qapi/qmp/qlist.h" #include "qapi/qmp/qstring.h" #include "qapi-event.h" diff --git a/blockjob.c b/blockjob.c index 9fc37ca..cafa576 100644 --- a/blockjob.c +++ b/blockjob.c @@ -31,7 +31,7 @@ #include "block/block_int.h" #include "sysemu/block-backend.h" #include "qapi/qmp/qerror.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qemu/coroutine.h" #include "qmp-commands.h" #include "qemu/timer.h" diff --git a/hw/core/qdev.c b/hw/core/qdev.c index db41aa1..1806d8b 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -31,7 +31,7 @@ #include "sysemu/sysemu.h" #include "qapi/qmp/qerror.h" #include "qapi/visitor.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qemu/error-report.h" #include "hw/hotplug.h" #include "hw/boards.h" diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index 0ac1e6a..0f2f38e 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -14,7 +14,7 @@ #include "qemu/osdep.h" #include "qapi/qmp/qobject.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "sysemu/sysemu.h" #include "qemu/log.h" diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 5798f87..a0ace28 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -22,7 +22,7 @@ #include "hw/virtio/virtio-net.h" #include "net/vhost_net.h" #include "hw/virtio/virtio-bus.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qapi-event.h" #include "hw/virtio/virtio-access.h" diff --git a/monitor.c b/monitor.c index d1c1930..3db357c 100644 --- a/monitor.c +++ b/monitor.c @@ -57,7 +57,7 @@ #include "qapi/qmp/qlist.h" #include "qapi/qmp/qbool.h" #include "qapi/qmp/qstring.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qapi/qmp/json-streamer.h" #include "qapi/qmp/json-parser.h" #include diff --git a/qapi/qmp-event.c b/qapi/qmp-event.c index 8bba165..af96d61 100644 --- a/qapi/qmp-event.c +++ b/qapi/qmp-event.c @@ -16,7 +16,7 @@ #include "qemu-common.h" #include "qapi/qmp-event.h" #include "qapi/qmp/qstring.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" static QMPEventFuncEmit qmp_emit; diff --git a/qemu-img.c b/qemu-img.c index 46f2a6d..e976851 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -26,7 +26,7 @@ #include "qapi-visit.h" #include "qapi/qmp-output-visitor.h" #include "qapi/qmp/qerror.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qemu/cutils.h" #include "qemu/config-file.h" #include "qemu/option.h" diff --git a/qga/main.c b/qga/main.c index c5527821..1c0315e 100644 --- a/qga/main.c +++ b/qga/main.c @@ -21,7 +21,7 @@ #include "qapi/qmp/json-streamer.h" #include "qapi/qmp/json-parser.h" #include "qapi/qmp/qint.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qga/guest-agent-core.h" #include "qemu/module.h" #include "qapi/qmp/qerror.h" diff --git a/qobject/qjson.c b/qobject/qobject-json.c similarity index 99% rename from qobject/qjson.c rename to qobject/qobject-json.c index ef160d2..bcc3f6e 100644 --- a/qobject/qjson.c +++ b/qobject/qobject-json.c @@ -15,7 +15,7 @@ #include "qapi/qmp/json-lexer.h" #include "qapi/qmp/json-parser.h" #include "qapi/qmp/json-streamer.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qapi/qmp/qint.h" #include "qapi/qmp/qlist.h" #include "qapi/qmp/qbool.h" diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index e1859ca..361d248 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -36,7 +36,7 @@ #include "hw/hw.h" #include "cpu.h" #include "sysemu/device_tree.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "exec/gdbstub.h" #include "exec/address-spaces.h" #include "trace.h" diff --git a/tests/check-qjson.c b/tests/check-qobject-json.c similarity index 99% rename from tests/check-qjson.c rename to tests/check-qobject-json.c index 99de6f5..dc721a8 100644 --- a/tests/check-qjson.c +++ b/tests/check-qobject-json.c @@ -19,7 +19,7 @@ #include "qapi/qmp/qlist.h" #include "qapi/qmp/qfloat.h" #include "qapi/qmp/qbool.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qemu-common.h" @@ -64,7 +64,7 @@ static void escaped_string(void) g_assert(obj != NULL); g_assert(qobject_type(obj) == QTYPE_QSTRING); - + str = qobject_to_qstring(obj); g_assert_cmpstr(qstring_get_str(str), ==, test_cases[i].decoded); @@ -99,7 +99,7 @@ static void simple_string(void) g_assert(obj != NULL); g_assert(qobject_type(obj) == QTYPE_QSTRING); - + str = qobject_to_qstring(obj); g_assert(strcmp(qstring_get_str(str), test_cases[i].decoded) == 0); @@ -107,7 +107,7 @@ static void simple_string(void) g_assert(strcmp(qstring_get_str(str), test_cases[i].encoded) == 0); qobject_decref(obj); - + QDECREF(str); } } @@ -133,7 +133,7 @@ static void single_quote_string(void) g_assert(obj != NULL); g_assert(qobject_type(obj) == QTYPE_QSTRING); - + str = qobject_to_qstring(obj); g_assert(strcmp(qstring_get_str(str), test_cases[i].decoded) == 0); @@ -881,7 +881,7 @@ static void vararg_string(void) g_assert(obj != NULL); g_assert(qobject_type(obj) == QTYPE_QSTRING); - + str = qobject_to_qstring(obj); g_assert(strcmp(qstring_get_str(str), test_cases[i].decoded) == 0); @@ -1145,7 +1145,7 @@ static int compare_litqobj_to_qobj(LiteralQObject *lhs, QObject *rhs) helper.index = 0; helper.objs = lhs->value.qlist; helper.result = 1; - + qlist_iter(qobject_to_qlist(rhs), compare_helper, &helper); return helper.result; diff --git a/tests/libqtest.c b/tests/libqtest.c index b12a9e4..2f42bc9 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -24,7 +24,7 @@ #include "qapi/qmp/json-parser.h" #include "qapi/qmp/json-streamer.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #define MAX_IRQ 256 #define SOCKET_TIMEOUT 5 diff --git a/ui/spice-core.c b/ui/spice-core.c index 61db3c1..9eec388 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -33,7 +33,7 @@ #include "qapi/qmp/qint.h" #include "qapi/qmp/qbool.h" #include "qapi/qmp/qstring.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qemu/notify.h" #include "migration/migration.h" #include "hw/hw.h" diff --git a/vl.c b/vl.c index 5fd22cb..2d62382 100644 --- a/vl.c +++ b/vl.c @@ -88,7 +88,7 @@ int main(int argc, char **argv) #include "audio/audio.h" #include "migration/migration.h" #include "sysemu/kvm.h" -#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qobject-json.h" #include "qemu/option.h" #include "qemu/config-file.h" #include "qemu-options.h" diff --git a/MAINTAINERS b/MAINTAINERS index 81e7fac..c56b657 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1190,7 +1190,7 @@ X: include/qapi/qmp/dispatch.h F: tests/check-qdict.c F: tests/check-qfloat.c F: tests/check-qint.c -F: tests/check-qjson.c +F: tests/check-qobject-json.c F: tests/check-qlist.c F: tests/check-qstring.c T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp diff --git a/qobject/Makefile.objs b/qobject/Makefile.objs index bed5508..16a48ec 100644 --- a/qobject/Makefile.objs +++ b/qobject/Makefile.objs @@ -1,2 +1,3 @@ util-obj-y = qnull.o qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o -util-obj-y += qjson.o qobject.o json-lexer.o json-streamer.o json-parser.o +util-obj-y += qobject-json.o qobject.o +util-obj-y += json-lexer.o json-streamer.o json-parser.o diff --git a/tests/.gitignore b/tests/.gitignore index a06a8ba..2f8c7ea 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,9 +1,9 @@ check-qdict check-qfloat check-qint -check-qjson check-qlist check-qnull +check-qobject-json check-qstring check-qom-interface check-qom-proplist diff --git a/tests/Makefile b/tests/Makefile index 9dddde6..f71ed1c 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -18,8 +18,8 @@ check-unit-y += tests/check-qlist$(EXESUF) gcov-files-check-qlist-y = qobject/qlist.c check-unit-y += tests/check-qnull$(EXESUF) gcov-files-check-qnull-y = qobject/qnull.c -check-unit-y += tests/check-qjson$(EXESUF) -gcov-files-check-qjson-y = qobject/qjson.c +check-unit-y += tests/check-qobject-json$(EXESUF) +gcov-files-check-qobject-json-y = qobject/qobject-json.c check-unit-y += tests/test-qmp-output-visitor$(EXESUF) gcov-files-test-qmp-output-visitor-y = qapi/qmp-output-visitor.c check-unit-y += tests/test-qmp-input-visitor$(EXESUF) @@ -385,7 +385,7 @@ GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h \ test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \ tests/check-qlist.o tests/check-qfloat.o tests/check-qnull.o \ - tests/check-qjson.o \ + tests/check-qobject-json.o \ tests/test-coroutine.o tests/test-string-output-visitor.o \ tests/test-string-input-visitor.o tests/test-qmp-output-visitor.o \ tests/test-qmp-input-visitor.o tests/test-qmp-input-strict.o \ @@ -414,7 +414,7 @@ tests/check-qdict$(EXESUF): tests/check-qdict.o $(test-util-obj-y) tests/check-qlist$(EXESUF): tests/check-qlist.o $(test-util-obj-y) tests/check-qfloat$(EXESUF): tests/check-qfloat.o $(test-util-obj-y) tests/check-qnull$(EXESUF): tests/check-qnull.o $(test-util-obj-y) -tests/check-qjson$(EXESUF): tests/check-qjson.o $(test-util-obj-y) +tests/check-qobject-json$(EXESUF): tests/check-qobject-json.o $(test-util-obj-y) tests/check-qom-interface$(EXESUF): tests/check-qom-interface.o $(test-qom-obj-y) tests/check-qom-proplist$(EXESUF): tests/check-qom-proplist.o $(test-qom-obj-y) tests/test-coroutine$(EXESUF): tests/test-coroutine.o $(test-block-obj-y)