From nobody Tue Feb 10 02:55:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150341181663730.45964864206894; Tue, 22 Aug 2017 07:23:36 -0700 (PDT) Received: from localhost ([::1]:47676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkA5f-0007Ld-EM for importer@patchew.org; Tue, 22 Aug 2017 10:23:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dk9Jq-0008UK-EE for qemu-devel@nongnu.org; Tue, 22 Aug 2017 09:34:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dk9Jp-0007Mq-5H for qemu-devel@nongnu.org; Tue, 22 Aug 2017 09:34:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60050) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dk9Jo-0007MA-SB for qemu-devel@nongnu.org; Tue, 22 Aug 2017 09:34:09 -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 67B1BC04D952; Tue, 22 Aug 2017 13:27:36 +0000 (UTC) Received: from localhost (ovpn-112-43.ams2.redhat.com [10.36.112.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id B391A81B5A; Tue, 22 Aug 2017 13:27:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 67B1BC04D952 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Tue, 22 Aug 2017 15:22:50 +0200 Message-Id: <20170822132255.23945-50-marcandre.lureau@redhat.com> In-Reply-To: <20170822132255.23945-1-marcandre.lureau@redhat.com> References: <20170822132255.23945-1-marcandre.lureau@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.32]); Tue, 22 Aug 2017 13:27:36 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 49/54] build-sys: make qemu qapi objects per-target 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: Michael Roth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster , Stefan Hajnoczi , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" QAPI can't do target-specific conditionals (the symbols are poisoned), and the work-around is to pretend the target-specific stuff is target-independent, with stubs for the other targets. Makes the target-specifity invisible in introspection. To unpoison the symbols, we need to move the generated QAPI code to the per-target build. Keep qapi-types.o qapi-visit.o in util-obj as they are necessary for common code, but they will be overwritten during the target link. Add some stubs for block events, in code shared by tools & qemu. The following patches will configure the schema to conditionally remove per-target disabled features. Drop "do_test_visitor_in_qmp_introspect(&&qmp_schema_qlit)" since it is no longer in a common object, and covered by "query-qmp-schema test" instead. Signed-off-by: Marc-Andr=C3=A9 Lureau --- stubs/qapi-event.c | 74 ++++++++++++++++++++++++++++++++++= ++++ tests/test-qobject-input-visitor.c | 1 - Makefile.objs | 9 +---- Makefile.target | 4 +++ stubs/Makefile.objs | 1 + trace/Makefile.objs | 2 +- 6 files changed, 81 insertions(+), 10 deletions(-) create mode 100644 stubs/qapi-event.c diff --git a/stubs/qapi-event.c b/stubs/qapi-event.c new file mode 100644 index 0000000000..9415299f3a --- /dev/null +++ b/stubs/qapi-event.c @@ -0,0 +1,74 @@ +#include "qemu/osdep.h" +#include "qapi-event.h" + +void qapi_event_send_device_tray_moved(const char *device, const char *id, + bool tray_open, Error **errp) +{ +} + +void qapi_event_send_quorum_report_bad(QuorumOpType type, bool has_error, + const char *error, const char *node= _name, + int64_t sector_num, + int64_t sectors_count, Error **errp) +{ +} + +void qapi_event_send_quorum_failure(const char *reference, int64_t sector_= num, + int64_t sectors_count, Error **errp) +{ +} + +void qapi_event_send_block_job_cancelled(BlockJobType type, const char *de= vice, + int64_t len, int64_t offset, + int64_t speed, Error **errp) +{ +} + +void qapi_event_send_block_job_completed(BlockJobType type, const char *de= vice, + int64_t len, int64_t offset, + int64_t speed, bool has_error, + const char *error, Error **errp) +{ +} + +void qapi_event_send_block_job_error(const char *device, + IoOperationType operation, + BlockErrorAction action, Error **errp) +{ +} + +void qapi_event_send_block_job_ready(BlockJobType type, const char *device, + int64_t len, int64_t offset, int64_t = speed, + Error **errp) +{ +} + +void qapi_event_send_block_io_error(const char *device, const char *node_n= ame, + IoOperationType operation, + BlockErrorAction action, bool has_nosp= ace, + bool nospace, const char *reason, + Error **errp) +{ +} + +void qapi_event_send_block_image_corrupted(const char *device, + bool has_node_name, + const char *node_name, + const char *msg, bool has_offse= t, + int64_t offset, bool has_size, + int64_t size, bool fatal, + Error **errp) +{ +} + +void qapi_event_send_block_write_threshold(const char *node_name, + uint64_t amount_exceeded, + uint64_t write_threshold, + Error **errp) +{ +} + +void qapi_event_send_device_deleted(bool has_device, const char *device, + const char *path, Error **errp) +{ +} diff --git a/tests/test-qobject-input-visitor.c b/tests/test-qobject-input-= visitor.c index be7d7ea654..bb35a4d15f 100644 --- a/tests/test-qobject-input-visitor.c +++ b/tests/test-qobject-input-visitor.c @@ -1267,7 +1267,6 @@ static void test_visitor_in_qmp_introspect(TestInputV= isitorData *data, const void *unused) { do_test_visitor_in_qmp_introspect(data, &test_qmp_schema_qlit); - do_test_visitor_in_qmp_introspect(data, &qmp_schema_qlit); } =20 int main(int argc, char **argv) diff --git a/Makefile.objs b/Makefile.objs index 24a4ea08b8..2664720f9b 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -2,7 +2,7 @@ # Common libraries for tools and emulators stub-obj-y =3D stubs/ crypto/ util-obj-y =3D util/ qobject/ qapi/ -util-obj-y +=3D qmp-introspect.o qapi-types.o qapi-visit.o qapi-event.o +util-obj-y +=3D qapi-types.o qapi-visit.o =20 chardev-obj-y =3D chardev/ =20 @@ -72,13 +72,6 @@ common-obj-y +=3D chardev/ common-obj-$(CONFIG_SECCOMP) +=3D qemu-seccomp.o =20 common-obj-$(CONFIG_FDT) +=3D device_tree.o - -###################################################################### -# qapi - -common-obj-y +=3D qmp-marshal.o -common-obj-y +=3D qmp-introspect.o -common-obj-y +=3D qmp.o hmp.o endif =20 ####################################################################### diff --git a/Makefile.target b/Makefile.target index 7f42c45db8..c5f8ded4fa 100644 --- a/Makefile.target +++ b/Makefile.target @@ -157,6 +157,10 @@ endif =20 GENERATED_FILES +=3D hmp-commands.h hmp-commands-info.h =20 +obj-y +=3D qmp-introspect.o qapi-types.o qapi-visit.o qapi-event.o +obj-y +=3D qmp-marshal.o qmp-introspect.o +obj-y +=3D qmp.o hmp.o + endif # CONFIG_SOFTMMU =20 # Workaround for http://gcc.gnu.org/PR55489, see configure. diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index e69c217aff..717b342c80 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -22,6 +22,7 @@ stub-obj-y +=3D migr-blocker.o stub-obj-y +=3D change-state-handler.o stub-obj-y +=3D monitor.o stub-obj-y +=3D notify-event.o +stub-obj-y +=3D qapi-event.o stub-obj-y +=3D qtest.o stub-obj-y +=3D replay.o stub-obj-y +=3D runstate-check.o diff --git a/trace/Makefile.objs b/trace/Makefile.objs index afd571c3ec..6447729d60 100644 --- a/trace/Makefile.objs +++ b/trace/Makefile.objs @@ -56,4 +56,4 @@ util-obj-$(CONFIG_TRACE_SIMPLE) +=3D simple.o util-obj-$(CONFIG_TRACE_FTRACE) +=3D ftrace.o util-obj-y +=3D control.o target-obj-y +=3D control-target.o -util-obj-y +=3D qmp.o +target-obj-y +=3D qmp.o --=20 2.14.1.146.gd35faa819