From patchwork Thu Jun 10 05:57:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490175 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Z25SnAUQ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tdK0h8vz9sRf for ; Thu, 10 Jun 2021 16:01:09 +1000 (AEST) Received: from localhost ([::1]:51118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDkZ-00069P-10 for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:01:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDhy-0001Zi-9B for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:58:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDhu-0001Ae-34 for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:58:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZZBIBypDtxJSJiM+f/nEPl3cXV/9a6YLFrIp/UYBmrw=; b=Z25SnAUQtGRlBJKDYkwjKH+taplgDtWa6nUBOv6LYl5JmiESUkeTXku6EI5R0vkULQflY/ gUVWIf3hdqAE5HOB0UWgcNbWxi6LaAEF4g/LbeYAvVnH8hhTkSSar5aXCYrHxgE1lFoWw5 r/lGo0VtjSu2QLVzVcdy5wCP1bADSRw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-543-PspOm8XYM_GUUVFfVYXaQA-1; Thu, 10 Jun 2021 01:58:16 -0400 X-MC-Unique: PspOm8XYM_GUUVFfVYXaQA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 93007801B16; Thu, 10 Jun 2021 05:58:14 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9476E60853; Thu, 10 Jun 2021 05:57:56 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4711E18007A3; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 01/18] modules: add metadata macros, add qxl module annotations Date: Thu, 10 Jun 2021 07:57:38 +0200 Message-Id: <20210610055755.538119-2-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Stealing an idea from the linux kernel: Place module metadata in an .modinfo elf section. This patch adds macros and qxl module annotations as example. Signed-off-by: Gerd Hoffmann --- include/qemu/module.h | 22 ++++++++++++++++++++++ hw/display/qxl.c | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/include/qemu/module.h b/include/qemu/module.h index 944d403cbd15..d3cab3c25a2f 100644 --- a/include/qemu/module.h +++ b/include/qemu/module.h @@ -73,4 +73,26 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail); void module_load_qom_one(const char *type); void module_load_qom_all(void); +/* + * macros to store module metadata in a .modinfo section. + * qemu-modinfo utility will collect the metadata. + * + * Use "objdump -t -s -j .modinfo ${module}.so" to inspect. + */ + +#define ___PASTE(a, b) a##b +#define __PASTE(a, b) ___PASTE(a, b) + +#define modinfo(kind, value) \ + static const char __PASTE(kind, __LINE__)[] \ + __attribute__((__used__)) \ + __attribute__((section(".modinfo"))) \ + __attribute__((aligned(1))) \ + = stringify(kind) "=" value + +#define module_obj(name) modinfo(obj, name) +#define module_dep(name) modinfo(dep, name) +#define module_arch(name) modinfo(arch, name) +#define module_opts(name) modinfo(opts, name) + #endif diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 6e1f8ff1b2a7..84f99088e0a0 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -2522,6 +2522,7 @@ static const TypeInfo qxl_primary_info = { .parent = TYPE_PCI_QXL, .class_init = qxl_primary_class_init, }; +module_obj("qxl-vga"); static void qxl_secondary_class_init(ObjectClass *klass, void *data) { @@ -2538,6 +2539,7 @@ static const TypeInfo qxl_secondary_info = { .parent = TYPE_PCI_QXL, .class_init = qxl_secondary_class_init, }; +module_obj("qxl"); static void qxl_register_types(void) { @@ -2547,3 +2549,5 @@ static void qxl_register_types(void) } type_init(qxl_register_types) + +module_dep("ui-spice-core"); From patchwork Thu Jun 10 05:57:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490173 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Cka1spV+; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tZz3M78z9s5R for ; Thu, 10 Jun 2021 15:59:07 +1000 (AEST) Received: from localhost ([::1]:45710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDib-0002Nr-FR for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 01:59:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDiA-0002CK-AO for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:58:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41437) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDi8-0001PU-Mm for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:58:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gF6+0SztsY4QwUwrEmME1bGc0f4ssDoBylC20Xy4lT4=; b=Cka1spV+theIoWVZ/nnRJMVddhDTocKYz3t1Sut8CmJgwfOKizNgljccPdMOkkO9SPCtxn OLnUfDWTbZEIsSa3SFjCkxMiZuSP5pE1gM8Jir75LVHIrQVUJKns2hnB2FfmquYwpv1Y2W of1mZsYIqWddSL/5Zop+XR11AEduDnw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-523-X5jTkqYxMveB2D7SuurP-Q-1; Thu, 10 Jun 2021 01:58:32 -0400 X-MC-Unique: X5jTkqYxMveB2D7SuurP-Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1D27E100C668; Thu, 10 Jun 2021 05:58:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 328B35D9E2; Thu, 10 Jun 2021 05:58:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 55BAD1800937; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 02/18] qapi: add ModuleInfo schema Date: Thu, 10 Jun 2021 07:57:39 +0200 Message-Id: <20210610055755.538119-3-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add QAPI schema for the module info database. Signed-off-by: Gerd Hoffmann --- qapi/meson.build | 1 + qapi/modules.json | 36 ++++++++++++++++++++++++++++++++++++ qapi/qapi-schema.json | 1 + 3 files changed, 38 insertions(+) create mode 100644 qapi/modules.json diff --git a/qapi/meson.build b/qapi/meson.build index 376f4ceafe74..596aa5d71168 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -36,6 +36,7 @@ qapi_all_modules = [ 'migration', 'misc', 'misc-target', + 'modules', 'net', 'pragma', 'qom', diff --git a/qapi/modules.json b/qapi/modules.json new file mode 100644 index 000000000000..5420977d8765 --- /dev/null +++ b/qapi/modules.json @@ -0,0 +1,36 @@ +# -*- Mode: Python -*- +# vim: filetype=python + +## +# @ModuleInfo: +# +# qemu module metadata +# +# @name: module name +# +# @objs: list of qom objects implemented by the module. +# +# @deps: list of other modules this module depends on. +# +# @arch: module architecture. +# +# @opts: qemu opts implemented by module. +# +# Since: 6.1 +## +{ 'struct': 'ModuleInfo', + 'data': { 'name' : 'str', + '*objs' : ['str'], + '*deps' : ['str'], + '*arch' : 'str', + '*opts' : 'str'}} + +## +# @Modules: +# +# qemu module list +# +# Since: 6.1 +## +{ 'struct': 'Modules', + 'data': { 'list' : ['ModuleInfo']}} diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index 4912b9744e69..5baa511c2ff5 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -93,3 +93,4 @@ { 'include': 'audio.json' } { 'include': 'acpi.json' } { 'include': 'pci.json' } +{ 'include': 'modules.json' } From patchwork Thu Jun 10 05:57:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ivlZ0RHZ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tjc5h1Dz9s5R for ; Thu, 10 Jun 2021 16:04:52 +1000 (AEST) Received: from localhost ([::1]:33136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDo9-0004kn-E0 for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:04:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDiA-0002D0-Hl for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:58:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDi8-0001P3-Af for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:58:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MOKUaPRhEknQSp/c4EpmFfYQpAw20I4djJwTGWMwLZw=; b=ivlZ0RHZLsr65liCVV84EjDHuZD/sPK/1+JL51As1/YqdjVl1HJd4V+Q076FjZnrIuWpoL f7StO2UjgZsG2dkvTaCmwgvMcEpQAF+HA5DAba2JuvsVWa/C68LUtxca3epm4hcMswFnym NutpaGExJFlwC2YrjMSYc//Zt7tGqG8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-256-1sog8kXgOamP2KVkZx7mOA-1; Thu, 10 Jun 2021 01:58:32 -0400 X-MC-Unique: 1sog8kXgOamP2KVkZx7mOA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1E327800D62; Thu, 10 Jun 2021 05:58:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1AE2819C46; Thu, 10 Jun 2021 05:58:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 63E2E180093F; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 03/18] modules: add qemu-modinfo utility Date: Thu, 10 Jun 2021 07:57:40 +0200 Message-Id: <20210610055755.538119-4-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Scan .modinfo sections of qemu modules, write module metadata to modinfo.json. Signed-off-by: Gerd Hoffmann --- qemu-modinfo.c | 270 +++++++++++++++++++++++++++++++++++++++++++++++++ meson.build | 11 ++ 2 files changed, 281 insertions(+) create mode 100644 qemu-modinfo.c diff --git a/qemu-modinfo.c b/qemu-modinfo.c new file mode 100644 index 000000000000..611dbdb00683 --- /dev/null +++ b/qemu-modinfo.c @@ -0,0 +1,270 @@ +/* + * QEMU module parser + * + * read modules, find modinfo section, parse & store metadata. + * + * Copyright Red Hat, Inc. 2021 + * + * Authors: + * Gerd Hoffmann + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "elf.h" +#include +#include + +#include "qapi/qapi-types-modules.h" +#include "qapi/qapi-visit-modules.h" +#include "qapi/qobject-output-visitor.h" +#include "qapi/qmp/qjson.h" +#include "qapi/qmp/qstring.h" + +#if INTPTR_MAX == INT32_MAX +# define Elf_Ehdr Elf32_Ehdr +# define Elf_Shdr Elf32_Shdr +# define ELFCLASS ELFCLASS32 +#elif INTPTR_MAX == INT64_MAX +# define Elf_Ehdr Elf64_Ehdr +# define Elf_Shdr Elf64_Shdr +# define ELFCLASS ELFCLASS64 +#else +# error Huh? Neither 32-bit nor 64-bit host. +#endif + +static const char *moddir = CONFIG_QEMU_MODDIR; +static const char *dsosuf = CONFIG_HOST_DSOSUF; + +static ModuleInfo *modinfo(const char *module, char *info, size_t size) +{ + ModuleInfo *modinfo; + strList *sl; + size_t pos = 0, len; + + modinfo = g_new0(ModuleInfo, 1); + modinfo->name = g_strdup(module); + + if (info) { + do { + if (strncmp(info + pos, "obj=", 4) == 0) { + sl = g_new0(strList, 1); + sl->value = g_strdup(info + pos + 4); + sl->next = modinfo->objs; + modinfo->objs = sl; + modinfo->has_objs = true; + } else if (strncmp(info + pos, "dep=", 4) == 0) { + sl = g_new0(strList, 1); + sl->value = g_strdup(info + pos + 4); + sl->next = modinfo->deps; + modinfo->deps = sl; + modinfo->has_deps = true; + } else if (strncmp(info + pos, "arch=", 5) == 0) { + modinfo->arch = g_strdup(info + pos + 5); + modinfo->has_arch = true; + } else if (strncmp(info + pos, "opts=", 5) == 0) { + modinfo->opts = g_strdup(info + pos + 5); + modinfo->has_opts = true; + } else { + fprintf(stderr, "unknown tag: %s\n", info + pos); + exit(1); + } + len = strlen(info + pos) + 1; + pos += len; + } while (pos < size); + } + + return modinfo; +} + +static void elf_read_section_hdr(FILE *fp, Elf_Ehdr *ehdr, + int section, Elf_Shdr *shdr) +{ + size_t pos, len; + int ret; + + pos = ehdr->e_shoff + section * ehdr->e_shentsize; + len = MIN(ehdr->e_shentsize, sizeof(*shdr)); + + ret = fseek(fp, pos, SEEK_SET); + if (ret != 0) { + fprintf(stderr, "seek error\n"); + exit(1); + } + + memset(shdr, 0, sizeof(*shdr)); + ret = fread(shdr, len, 1, fp); + if (ret != 1) { + fprintf(stderr, "read error\n"); + exit(1); + } +} + +static void *elf_read_section(FILE *fp, Elf_Ehdr *ehdr, + int section, size_t *size) +{ + Elf_Shdr shdr; + void *data; + int ret; + + elf_read_section_hdr(fp, ehdr, section, &shdr); + if (shdr.sh_offset && shdr.sh_size) { + ret = fseek(fp, shdr.sh_offset, SEEK_SET); + if (ret != 0) { + fprintf(stderr, "seek error\n"); + exit(1); + } + + data = g_malloc(shdr.sh_size); + ret = fread(data, shdr.sh_size, 1, fp); + if (ret != 1) { + fprintf(stderr, "read error\n"); + exit(1); + } + *size = shdr.sh_size; + } else { + data = NULL; + *size = 0; + } + return data; +} + +static ModuleInfo *elf_parse_module(const char *module, + const char *filename) +{ + Elf_Ehdr ehdr; + Elf_Shdr shdr; + FILE *fp; + int ret, i; + char *str; + size_t str_size; + char *info; + size_t info_size; + + fp = fopen(filename, "r"); + if (NULL == fp) { + fprintf(stderr, "open %s: %s\n", filename, strerror(errno)); + exit(1); + } + + ret = fread(&ehdr, sizeof(ehdr), 1, fp); + if (ret != 1) { + fprintf(stderr, "read error (%s)\n", filename); + exit(1); + } + + if (ehdr.e_ident[EI_MAG0] != ELFMAG0 || + ehdr.e_ident[EI_MAG1] != ELFMAG1 || + ehdr.e_ident[EI_MAG2] != ELFMAG2 || + ehdr.e_ident[EI_MAG3] != ELFMAG3) { + fprintf(stderr, "not an elf file (%s)\n", filename); + exit(1); + } + if (ehdr.e_ident[EI_CLASS] != ELFCLASS64) { + fprintf(stderr, "elf class mismatch (%s)\n", filename); + exit(1); + } + if (ehdr.e_shoff == 0) { + fprintf(stderr, "no section header (%s)\n", filename); + exit(1); + } + + /* read string table */ + if (ehdr.e_shstrndx == 0) { + fprintf(stderr, "no section strings (%s)\n", filename); + exit(1); + } + str = elf_read_section(fp, &ehdr, ehdr.e_shstrndx, &str_size); + if (NULL == str) { + fprintf(stderr, "no section strings (%s)\n", filename); + exit(1); + } + + /* find and read modinfo section */ + info = NULL; + for (i = 0; i < ehdr.e_shnum; i++) { + elf_read_section_hdr(fp, &ehdr, i, &shdr); + if (!shdr.sh_name) { + continue; + } + if (strcmp(str + shdr.sh_name, ".modinfo") == 0) { + info = elf_read_section(fp, &ehdr, i, &info_size); + } + } + fclose(fp); + + return modinfo(module, info, info_size); +} + +int main(int argc, char **argv) +{ + DIR *dir; + FILE *fp; + ModuleInfo *modinfo; + ModuleInfoList *modlist; + Modules *modules; + Visitor *v; + QObject *obj; + Error *errp = NULL; + struct dirent *ent; + char *ext, *file, *name; + GString *gjson; + QString *qjson; + const char *json; + + if (argc > 1) { + moddir = argv[1]; + } + + dir = opendir(moddir); + if (dir == NULL) { + fprintf(stderr, "opendir(%s): %s\n", moddir, strerror(errno)); + exit(1); + } + + modules = g_new0(Modules, 1); + while (NULL != (ent = readdir(dir))) { + ext = strrchr(ent->d_name, '.'); + if (!ext) { + continue; + } + if (strcmp(ext, dsosuf) != 0) { + continue; + } + + name = g_strndup(ent->d_name, ext - ent->d_name); + file = g_strdup_printf("%s/%s", moddir, ent->d_name); + modinfo = elf_parse_module(name, file); + g_free(file); + g_free(name); + + modlist = g_new0(ModuleInfoList, 1); + modlist->value = modinfo; + modlist->next = modules->list; + modules->list = modlist; + } + closedir(dir); + + v = qobject_output_visitor_new(&obj); + visit_type_Modules(v, NULL, &modules, &errp); + visit_complete(v, &obj); + visit_free(v); + + gjson = qobject_to_json(obj); + qjson = qstring_from_gstring(gjson); + json = qstring_get_str(qjson); + + file = g_strdup_printf("%s/modinfo.json", moddir); + fp = fopen(file, "w"); + if (fp == NULL) { + fprintf(stderr, "open(%s): %s\n", file, strerror(errno)); + exit(1); + } + fprintf(fp, "%s", json); + fclose(fp); + + printf("%s written\n", file); + g_free(file); + return 0; +} diff --git a/meson.build b/meson.build index d2a9ce91f556..9823c5889140 100644 --- a/meson.build +++ b/meson.build @@ -2380,6 +2380,17 @@ if xkbcommon.found() dependencies: [qemuutil, xkbcommon], install: have_tools) endif +if config_host.has_key('CONFIG_MODULES') + qemu_modinfo = executable('qemu-modinfo', files('qemu-modinfo.c') + genh, + dependencies: [glib, qemuutil], install: have_tools) + custom_target('modinfo.json', + input: [ softmmu_mods, block_mods ], + output: 'modinfo.json', + install: true, + install_dir: qemu_moddir, + command: [ qemu_modinfo, '.' ]) +endif + if have_tools qemu_img = executable('qemu-img', [files('qemu-img.c'), hxdep], dependencies: [authz, block, crypto, io, qom, qemuutil], install: true) From patchwork Thu Jun 10 05:57:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VpsoBE6+; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tmN2jgwz9s5R for ; Thu, 10 Jun 2021 16:07:16 +1000 (AEST) Received: from localhost ([::1]:41316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDqU-0001oP-AU for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:07:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDiP-0002yb-HH for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:58:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDiL-0001cl-Ao for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:58:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2N0mgQnSR8oAerjxg2YBYHZ3p88z8Ru0HgqydZqU+xg=; b=VpsoBE6+zN+8YLul/IDfbHzfwZO+/aRfh38MHQO6pyFWoBgnvOyAjUGnbEiQauVeDcUqs+ yxkNCRVU4/O10hldy8GSf0SW/C1ISdxDuuRyxrRulfhKlS1DXATdeGRdiqWkBxzd/wr/dh ruahH+V46Dr8B3QswtJLJKDGAn0gsbw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-51-lGi-i7rIMsinFhH2JSRMrw-1; Thu, 10 Jun 2021 01:58:47 -0400 X-MC-Unique: lGi-i7rIMsinFhH2JSRMrw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E7536801B19; Thu, 10 Jun 2021 05:58:45 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BE9C018A69; Thu, 10 Jun 2021 05:58:32 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7F9D918009C4; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 04/18] modules: add virtio-gpu module annotations Date: Thu, 10 Jun 2021 07:57:41 +0200 Message-Id: <20210610055755.538119-5-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann --- hw/display/vhost-user-gpu-pci.c | 1 + hw/display/vhost-user-gpu.c | 1 + hw/display/vhost-user-vga.c | 1 + hw/display/virtio-gpu-base.c | 1 + hw/display/virtio-gpu-gl.c | 3 +++ hw/display/virtio-gpu-pci-gl.c | 3 +++ hw/display/virtio-gpu-pci.c | 2 ++ hw/display/virtio-gpu.c | 1 + hw/display/virtio-vga-gl.c | 3 +++ hw/display/virtio-vga.c | 2 ++ 10 files changed, 18 insertions(+) diff --git a/hw/display/vhost-user-gpu-pci.c b/hw/display/vhost-user-gpu-pci.c index a02b23ecaf11..daefcf710159 100644 --- a/hw/display/vhost-user-gpu-pci.c +++ b/hw/display/vhost-user-gpu-pci.c @@ -43,6 +43,7 @@ static const VirtioPCIDeviceTypeInfo vhost_user_gpu_pci_info = { .instance_size = sizeof(VhostUserGPUPCI), .instance_init = vhost_user_gpu_pci_initfn, }; +module_obj(TYPE_VHOST_USER_GPU_PCI); static void vhost_user_gpu_pci_register_types(void) { diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c index 6cdaa1c73b9b..32ef0061f924 100644 --- a/hw/display/vhost-user-gpu.c +++ b/hw/display/vhost-user-gpu.c @@ -596,6 +596,7 @@ static const TypeInfo vhost_user_gpu_info = { .instance_finalize = vhost_user_gpu_instance_finalize, .class_init = vhost_user_gpu_class_init, }; +module_obj(TYPE_VHOST_USER_GPU); static void vhost_user_gpu_register_types(void) { diff --git a/hw/display/vhost-user-vga.c b/hw/display/vhost-user-vga.c index a34a99856d73..072c9c65bc75 100644 --- a/hw/display/vhost-user-vga.c +++ b/hw/display/vhost-user-vga.c @@ -44,6 +44,7 @@ static const VirtioPCIDeviceTypeInfo vhost_user_vga_info = { .instance_size = sizeof(VhostUserVGA), .instance_init = vhost_user_vga_inst_initfn, }; +module_obj(TYPE_VHOST_USER_VGA); static void vhost_user_vga_register_types(void) { diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c index dd294276cb38..c8da4806e0bb 100644 --- a/hw/display/virtio-gpu-base.c +++ b/hw/display/virtio-gpu-base.c @@ -256,6 +256,7 @@ static const TypeInfo virtio_gpu_base_info = { .class_init = virtio_gpu_base_class_init, .abstract = true }; +module_obj(TYPE_VIRTIO_GPU_BASE); static void virtio_register_types(void) diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index d971b480806a..7ab93bf8c829 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -154,6 +154,7 @@ static const TypeInfo virtio_gpu_gl_info = { .instance_size = sizeof(VirtIOGPUGL), .class_init = virtio_gpu_gl_class_init, }; +module_obj(TYPE_VIRTIO_GPU_GL); static void virtio_register_types(void) { @@ -161,3 +162,5 @@ static void virtio_register_types(void) } type_init(virtio_register_types) + +module_dep("hw-display-virtio-gpu"); diff --git a/hw/display/virtio-gpu-pci-gl.c b/hw/display/virtio-gpu-pci-gl.c index 902dda345275..99b14a07185e 100644 --- a/hw/display/virtio-gpu-pci-gl.c +++ b/hw/display/virtio-gpu-pci-gl.c @@ -46,6 +46,7 @@ static const VirtioPCIDeviceTypeInfo virtio_gpu_gl_pci_info = { .instance_size = sizeof(VirtIOGPUGLPCI), .instance_init = virtio_gpu_gl_initfn, }; +module_obj(TYPE_VIRTIO_GPU_GL_PCI); static void virtio_gpu_gl_pci_register_types(void) { @@ -53,3 +54,5 @@ static void virtio_gpu_gl_pci_register_types(void) } type_init(virtio_gpu_gl_pci_register_types) + +module_dep("hw-display-virtio-gpu-pci"); diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c index d742a30aecf7..e36eee0c409b 100644 --- a/hw/display/virtio-gpu-pci.c +++ b/hw/display/virtio-gpu-pci.c @@ -64,6 +64,7 @@ static const TypeInfo virtio_gpu_pci_base_info = { .class_init = virtio_gpu_pci_base_class_init, .abstract = true }; +module_obj(TYPE_VIRTIO_GPU_PCI_BASE); #define TYPE_VIRTIO_GPU_PCI "virtio-gpu-pci" typedef struct VirtIOGPUPCI VirtIOGPUPCI; @@ -90,6 +91,7 @@ static const VirtioPCIDeviceTypeInfo virtio_gpu_pci_info = { .instance_size = sizeof(VirtIOGPUPCI), .instance_init = virtio_gpu_initfn, }; +module_obj(TYPE_VIRTIO_GPU_PCI); static void virtio_gpu_pci_register_types(void) { diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 4d549377cbc1..68fd607c2711 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -1419,6 +1419,7 @@ static const TypeInfo virtio_gpu_info = { .class_size = sizeof(VirtIOGPUClass), .class_init = virtio_gpu_class_init, }; +module_obj(TYPE_VIRTIO_GPU); static void virtio_register_types(void) { diff --git a/hw/display/virtio-vga-gl.c b/hw/display/virtio-vga-gl.c index c971340ebb1a..f22549097c5e 100644 --- a/hw/display/virtio-vga-gl.c +++ b/hw/display/virtio-vga-gl.c @@ -36,6 +36,7 @@ static VirtioPCIDeviceTypeInfo virtio_vga_gl_info = { .instance_size = sizeof(VirtIOVGAGL), .instance_init = virtio_vga_gl_inst_initfn, }; +module_obj(TYPE_VIRTIO_VGA_GL); static void virtio_vga_register_types(void) { @@ -45,3 +46,5 @@ static void virtio_vga_register_types(void) } type_init(virtio_vga_register_types) + +module_dep("hw-display-virtio-vga"); diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index d3c640406152..9e57f61e9edb 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -239,6 +239,7 @@ static TypeInfo virtio_vga_base_info = { .class_init = virtio_vga_base_class_init, .abstract = true, }; +module_obj(TYPE_VIRTIO_VGA_BASE); #define TYPE_VIRTIO_VGA "virtio-vga" @@ -268,6 +269,7 @@ static VirtioPCIDeviceTypeInfo virtio_vga_info = { .instance_size = sizeof(VirtIOVGA), .instance_init = virtio_vga_inst_initfn, }; +module_obj(TYPE_VIRTIO_VGA); static void virtio_vga_register_types(void) { From patchwork Thu Jun 10 05:57:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490174 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=T+kwJ0st; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tbS4pw2z9s5R for ; Thu, 10 Jun 2021 15:59:32 +1000 (AEST) Received: from localhost ([::1]:46578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDj0-000301-L1 for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 01:59:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDiN-0002t7-Oj for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:58:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47992) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDiK-0001bf-Mt for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:58:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8HVkjQbly3dsiItgADM//9yMkxJsBU/36GStGQA/SeE=; b=T+kwJ0stFPU/Hjlpyr1ggzhYw2gn2njrTujj4V+klzqndEundGPNm4bQa3fj4qckw6M19N ZHmp3DXaSsUFHoSyjc+erocvRs7QyW0l51v/qTnSNQNWKxy8iKCQdeB4mbuLpvPYQ+qKV5 RYD7UO+GscUx3RO3Acga9BjR9XFes4w= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-329-c8kMfcGIOzinZ32b7BK-Bg-1; Thu, 10 Jun 2021 01:58:47 -0400 X-MC-Unique: c8kMfcGIOzinZ32b7BK-Bg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 60D5219200C0; Thu, 10 Jun 2021 05:58:45 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1CB95D6BA; Thu, 10 Jun 2021 05:58:32 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8C9B518017C9; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 05/18] modules: add chardev module annotations Date: Thu, 10 Jun 2021 07:57:42 +0200 Message-Id: <20210610055755.538119-6-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann --- chardev/baum.c | 1 + chardev/spice.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/chardev/baum.c b/chardev/baum.c index 5deca778bc44..79d618e35045 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -680,6 +680,7 @@ static const TypeInfo char_braille_type_info = { .instance_finalize = char_braille_finalize, .class_init = char_braille_class_init, }; +module_obj(TYPE_CHARDEV_BRAILLE); static void register_types(void) { diff --git a/chardev/spice.c b/chardev/spice.c index 1104426e3a11..3ffb3fdc0dac 100644 --- a/chardev/spice.c +++ b/chardev/spice.c @@ -366,6 +366,7 @@ static const TypeInfo char_spice_type_info = { .class_init = char_spice_class_init, .abstract = true, }; +module_obj(TYPE_CHARDEV_SPICE); static void char_spicevmc_class_init(ObjectClass *oc, void *data) { @@ -396,6 +397,7 @@ static const TypeInfo char_spiceport_type_info = { .parent = TYPE_CHARDEV_SPICE, .class_init = char_spiceport_class_init, }; +module_obj(TYPE_CHARDEV_SPICEPORT); static void register_types(void) { @@ -405,3 +407,5 @@ static void register_types(void) } type_init(register_types); + +module_dep("ui-spice-core"); From patchwork Thu Jun 10 05:57:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Qp+F6OC7; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tfn3KS3z9s5R for ; Thu, 10 Jun 2021 16:02:25 +1000 (AEST) Received: from localhost ([::1]:54512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDln-000076-BY for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:02:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDie-0003bX-HV for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDia-0001pL-VK for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rQZiTj29EkUI3JcZ8Wr4DuhMvRhsE3YMv7zgpWxKx8Q=; b=Qp+F6OC7wYRE8tf/tQ9on8H8YKWW9M7g3WSYB3UXuRkKKT59op5ecDl5tAsglUmBI3pNqE ylUh72/uoEVftUyJVQQ1vU5MGhA6zY6WB0C3yyt32rVCZGMY1obA2tXIL7MW1eOfs2UOWY s7FqJY4GyjB11HxAqD8KshDBp6EiC3w= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-268-E-DaIfijNiyIDV6N-K3vbw-1; Thu, 10 Jun 2021 01:59:03 -0400 X-MC-Unique: E-DaIfijNiyIDV6N-K3vbw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 193DF8015C6; Thu, 10 Jun 2021 05:59:02 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC68119C46; Thu, 10 Jun 2021 05:58:46 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 97A0718017CB; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 06/18] modules: add audio module annotations Date: Thu, 10 Jun 2021 07:57:43 +0200 Message-Id: <20210610055755.538119-7-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann --- audio/spiceaudio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index 999bfbde47c5..a8d370fe6f31 100644 --- a/audio/spiceaudio.c +++ b/audio/spiceaudio.c @@ -317,3 +317,5 @@ static void register_audio_spice(void) audio_driver_register(&spice_audio_driver); } type_init(register_audio_spice); + +module_dep("ui-spice-core"); From patchwork Thu Jun 10 05:57:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490178 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=hqKrQqVn; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tg6560mz9s5R for ; Thu, 10 Jun 2021 16:02:42 +1000 (AEST) Received: from localhost ([::1]:55400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDm4-0000ju-O1 for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:02:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDig-0003iw-PX for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDib-0001q4-JD for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=47S+hKkrRx4hDRMeJz2IyNQwdb7IvNGZaEvXYRCjttw=; b=hqKrQqVnXm+xEgpme4L+cMQ3RvqCCgCaP2Jkm6FJ1yQrpF0bdgMaMiiySP9822S0TmNx2e eGJPNWQKF29lm6v6of2dcbDbmoSQza95/Ly21ss5BbrEMPHuuxTgAzbCySvFGKs/vfGogC JA3DH1szW89I/7kYSv/KVarei1Zhn2Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-465-dsRdhwSWOrunLJn6KdaGzw-1; Thu, 10 Jun 2021 01:59:03 -0400 X-MC-Unique: dsRdhwSWOrunLJn6KdaGzw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 187935721E; Thu, 10 Jun 2021 05:59:02 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 611A119726; Thu, 10 Jun 2021 05:58:47 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A2A7A18017CC; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 07/18] modules: add usb-redir module annotations Date: Thu, 10 Jun 2021 07:57:44 +0200 Message-Id: <20210610055755.538119-8-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann --- hw/usb/redirect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 6a75b0dc4ab2..4ec9326e0582 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -2608,6 +2608,7 @@ static const TypeInfo usbredir_dev_info = { .class_init = usbredir_class_initfn, .instance_init = usbredir_instance_init, }; +module_obj(TYPE_USB_REDIR); static void usbredir_register_types(void) { From patchwork Thu Jun 10 05:57:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IgcCXJhs; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tqD3PMWz9s5R for ; Thu, 10 Jun 2021 16:09:44 +1000 (AEST) Received: from localhost ([::1]:47862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDss-0006Hu-Eh for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:09:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDiu-0004Jw-Tv for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52293) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDir-00021b-OW for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ynhXTHj1vgTX7K0qlPMPEtoJitMeHYDFd80j2X87xgo=; b=IgcCXJhs8YEut0MNxiwu60/+H+OYyWszGjTxIM0Pwxm3o21rOO/NOXlWLZn7hVfVGoIXWb 9jzOTGIbrZlP+BQVPNXV2G5jAjn2hQIUK8TPkQtAElMOficfI06MNvyIpdxOvWM3kwqLuT QN+x9pETOlmus6J7eQcJ+MDVmNdxHZI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-338-wgtI3txrNC66iTTr5mw1hA-1; Thu, 10 Jun 2021 01:59:18 -0400 X-MC-Unique: wgtI3txrNC66iTTr5mw1hA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD5E48015A4; Thu, 10 Jun 2021 05:59:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8CEF718A69; Thu, 10 Jun 2021 05:59:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AF0D218017CD; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 08/18] modules: add ccid module annotations Date: Thu, 10 Jun 2021 07:57:45 +0200 Message-Id: <20210610055755.538119-9-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann --- hw/usb/ccid-card-emulated.c | 1 + hw/usb/ccid-card-passthru.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index 5c76bed77aa0..6c8c0355e099 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid-card-emulated.c @@ -612,6 +612,7 @@ static const TypeInfo emulated_card_info = { .instance_size = sizeof(EmulatedState), .class_init = emulated_class_initfn, }; +module_obj(TYPE_EMULATED_CCID); static void ccid_card_emulated_register_types(void) { diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index 7212d0d7fb5e..fa3040fb7154 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -414,6 +414,7 @@ static const TypeInfo passthru_card_info = { .instance_size = sizeof(PassthruState), .class_init = passthru_class_initfn, }; +module_obj(TYPE_CCID_PASSTHRU); static void ccid_card_passthru_register_types(void) { From patchwork Thu Jun 10 05:57:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490181 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IMO7GtX6; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tkg0x9Mz9s5R for ; Thu, 10 Jun 2021 16:05:47 +1000 (AEST) Received: from localhost ([::1]:35974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDp3-0006cq-3k for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:05:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDiu-0004Jx-WA for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDir-00020m-CE for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GMG26To2HhIsReHw8mY+AHfK8bISyekAm9NisM1uWFU=; b=IMO7GtX64kGGiJR09ZgcDlWu3lE2kD8xbsmt1tJMTEVpTYpXjiR8Lv/131MqG5MpvJmoKY qMUkTz3lBcfpeVxdHNSl54M1g7T/cJFYWI309uh5goUrv+IWEV4ZwpnGK6hMmJpdLK+kLJ 91rqSsEczZvDjYxqtf2ntoo9b0vnaNE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-429-vKLz1CgVOe-fOFwwylnm6Q-1; Thu, 10 Jun 2021 01:59:18 -0400 X-MC-Unique: vKLz1CgVOe-fOFwwylnm6Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C4E40100C663; Thu, 10 Jun 2021 05:59:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 918FF10016F4; Thu, 10 Jun 2021 05:59:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C16BD18017CE; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 09/18] modules: add ui module annotations Date: Thu, 10 Jun 2021 07:57:46 +0200 Message-Id: <20210610055755.538119-10-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann --- ui/egl-headless.c | 4 ++++ ui/gtk.c | 4 ++++ ui/sdl2.c | 4 ++++ ui/spice-app.c | 3 +++ ui/spice-core.c | 5 +++++ 5 files changed, 20 insertions(+) diff --git a/ui/egl-headless.c b/ui/egl-headless.c index da377a74af69..75404e0e8700 100644 --- a/ui/egl-headless.c +++ b/ui/egl-headless.c @@ -213,3 +213,7 @@ static void register_egl(void) } type_init(register_egl); + +#ifdef CONFIG_OPENGL +module_dep("ui-opengl"); +#endif diff --git a/ui/gtk.c b/ui/gtk.c index 98046f577b9d..376b4d528daa 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -2333,3 +2333,7 @@ static void register_gtk(void) } type_init(register_gtk); + +#ifdef CONFIG_OPENGL +module_dep("ui-opengl"); +#endif diff --git a/ui/sdl2.c b/ui/sdl2.c index a203cb0239e1..36d9010cb6c1 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -918,3 +918,7 @@ static void register_sdl1(void) } type_init(register_sdl1); + +#ifdef CONFIG_OPENGL +module_dep("ui-opengl"); +#endif diff --git a/ui/spice-app.c b/ui/spice-app.c index 4325ac2d9c54..641f4a9d53e3 100644 --- a/ui/spice-app.c +++ b/ui/spice-app.c @@ -221,3 +221,6 @@ static void register_spice_app(void) } type_init(register_spice_app); + +module_dep("ui-spice-core"); +module_dep("chardev-spice"); diff --git a/ui/spice-core.c b/ui/spice-core.c index 272d19b0c152..86d43783acac 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -1037,3 +1037,8 @@ static void spice_register_config(void) qemu_add_opts(&qemu_spice_opts); } opts_init(spice_register_config); +module_opts("spice"); + +#ifdef CONFIG_OPENGL +module_dep("ui-opengl"); +#endif From patchwork Thu Jun 10 05:57:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490183 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=hfoDs81R; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tn55lV5z9s5R for ; Thu, 10 Jun 2021 16:07:53 +1000 (AEST) Received: from localhost ([::1]:43198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDr5-00034L-QL for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:07:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDj8-0004ym-Fh for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38358) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDj4-0002C7-A8 for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Sj1Po7tVmKlopcgqBw4EOoHUga5mbhDkJwIGENn43Lo=; b=hfoDs81RbWkLCB3uZWBTcyA1tfzvGnx329KiEvuAsqeA6SaJFD/6SoFKp7CFIs1BSjJRrU WbA3b2FlwRbJrYcBNukhQfb/Yn6dOz3mUzHxa/JmyYIkuVfhRMifHNml27i8Qk23+tHuXO Vadxzbdd3YRXrUDCkamAVQ+ExlYNk9Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-302-DvALgqe8OlCWaH6hZjsvWg-1; Thu, 10 Jun 2021 01:59:32 -0400 X-MC-Unique: DvALgqe8OlCWaH6hZjsvWg-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id D7EA2801B12; Thu, 10 Jun 2021 05:59:30 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 52D2960C05; Thu, 10 Jun 2021 05:59:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CCD5718017D1; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 10/18] modules: add s390x module annotations Date: Thu, 10 Jun 2021 07:57:47 +0200 Message-Id: <20210610055755.538119-11-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann --- hw/s390x/virtio-ccw-gpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/s390x/virtio-ccw-gpu.c b/hw/s390x/virtio-ccw-gpu.c index 75a9e4bb3908..5868a2a07093 100644 --- a/hw/s390x/virtio-ccw-gpu.c +++ b/hw/s390x/virtio-ccw-gpu.c @@ -59,6 +59,7 @@ static const TypeInfo virtio_ccw_gpu = { .instance_init = virtio_ccw_gpu_instance_init, .class_init = virtio_ccw_gpu_class_init, }; +module_obj(TYPE_VIRTIO_GPU_CCW); static void virtio_ccw_gpu_register(void) { @@ -68,3 +69,5 @@ static void virtio_ccw_gpu_register(void) } type_init(virtio_ccw_gpu_register) + +module_arch("s390x"); From patchwork Thu Jun 10 05:57:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490180 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Y0ELYtk0; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tkX6D9Mz9s5R for ; Thu, 10 Jun 2021 16:05:40 +1000 (AEST) Received: from localhost ([::1]:35616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDow-0006Oy-Jp for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:05:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDj5-0004o8-Ng for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40206) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDj4-0002Bz-32 for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bil6m6lPZf8+EkEMYi7OXN5QFOi3mSyraEjZidNLU2A=; b=Y0ELYtk00gYwT+71Wn24clpHEQl1R/UWv3ne8hQvhU4H/a1cA5JwZm7XRhNQ0JTkSnqK5o +A6geDxe2qfSS1TB3oXClIg3LjRMPdbwSmBPwbfvQ+9p3NN3d4LWetxGuqiUygiuc4l/Hh KPTx99Zpo6AJLGrax0uYxX92MVavZ1Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-106-e2qEri7DPb2-ilUXGRUXnw-1; Thu, 10 Jun 2021 01:59:32 -0400 X-MC-Unique: e2qEri7DPb2-ilUXGRUXnw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 038F3101C8A9; Thu, 10 Jun 2021 05:59:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 56A155D6AD; Thu, 10 Jun 2021 05:59:18 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D7F6C18017D2; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 11/18] modules: add block module annotations Date: Thu, 10 Jun 2021 07:57:48 +0200 Message-Id: <20210610055755.538119-12-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann --- block/iscsi-opts.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/iscsi-opts.c b/block/iscsi-opts.c index afaf8837d6c1..4f2da405e645 100644 --- a/block/iscsi-opts.c +++ b/block/iscsi-opts.c @@ -68,3 +68,4 @@ static void iscsi_block_opts_init(void) } block_init(iscsi_block_opts_init); +module_opts("iscsi"); From patchwork Thu Jun 10 05:57:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490188 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XAfwrzjD; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0ttv4PRJz9s5R for ; Thu, 10 Jun 2021 16:12:55 +1000 (AEST) Received: from localhost ([::1]:56264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDvx-0003nG-LA for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:12:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDjP-0005k9-AD for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29265) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDjN-0002Uo-Gt for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sV4aB/aDk6IWBiZQ3qH+tzuJbJ738mCY2QlQR4APApY=; b=XAfwrzjDH7nbTD1quVSADyEs2IyuXZpsmNoZCgdqsB/x9hSSjX3YoGxDm+cRdagKLUaM9I 0eRepmb/ZlKU+KLiqQrGXV7lbG4NjxnLI35ihx/H/25o2xnQY/2/1a8g6iJtwxqYoO92fY JHWjfLqGPhDQllxWmE4RhOaIHPxDyhY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-193-5RuFhQ0sMdmZpnMVHNGS4A-1; Thu, 10 Jun 2021 01:59:49 -0400 X-MC-Unique: 5RuFhQ0sMdmZpnMVHNGS4A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC061101C8A9; Thu, 10 Jun 2021 05:59:47 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6FEC119C46; Thu, 10 Jun 2021 05:59:32 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id EBA5718017D3; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 12/18] modules: add module_load_path_init helper Date: Thu, 10 Jun 2021 07:57:49 +0200 Message-Id: <20210610055755.538119-13-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Factor out module search path initialization to the new module_load_path_init() helper. Also store the search path in global variables and keep it so we have to do it only once. Signed-off-by: Gerd Hoffmann --- util/module.c | 58 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/util/module.c b/util/module.c index eee8ff2de136..3a2d6dde9734 100644 --- a/util/module.c +++ b/util/module.c @@ -110,6 +110,36 @@ void module_call_init(module_init_type type) } #ifdef CONFIG_MODULES + +static char *module_dirs[5]; +static int module_ndirs; + +static void module_load_path_init(void) +{ + const char *search_dir; + + if (module_ndirs) { + return; + } + + search_dir = getenv("QEMU_MODULE_DIR"); + if (search_dir != NULL) { + module_dirs[module_ndirs++] = g_strdup_printf("%s", search_dir); + } + module_dirs[module_ndirs++] = get_relocated_path(CONFIG_QEMU_MODDIR); + module_dirs[module_ndirs++] = g_strdup(qemu_get_exec_dir()); + +#ifdef CONFIG_MODULE_UPGRADES + version_dir = g_strcanon(g_strdup(QEMU_PKGVERSION), + G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "+-.~", + '_'); + module_dirs[module_ndirs++] = g_strdup_printf("/var/run/qemu/%s", version_dir); +#endif + + assert(module_ndirs <= ARRAY_SIZE(module_dirs)); + +} + static int module_load_file(const char *fname, bool mayfail, bool export_symbols) { GModule *g_module; @@ -204,10 +234,8 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) #ifdef CONFIG_MODULE_UPGRADES char *version_dir; #endif - const char *search_dir; - char *dirs[5]; char *module_name; - int i = 0, n_dirs = 0; + int i = 0; int ret, dep; bool export_symbols = false; static GHashTable *loaded_modules; @@ -240,25 +268,11 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) } g_hash_table_add(loaded_modules, module_name); - search_dir = getenv("QEMU_MODULE_DIR"); - if (search_dir != NULL) { - dirs[n_dirs++] = g_strdup_printf("%s", search_dir); - } - dirs[n_dirs++] = get_relocated_path(CONFIG_QEMU_MODDIR); - dirs[n_dirs++] = g_strdup(qemu_get_exec_dir()); + module_load_path_init(); -#ifdef CONFIG_MODULE_UPGRADES - version_dir = g_strcanon(g_strdup(QEMU_PKGVERSION), - G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "+-.~", - '_'); - dirs[n_dirs++] = g_strdup_printf("/var/run/qemu/%s", version_dir); -#endif - - assert(n_dirs <= ARRAY_SIZE(dirs)); - - for (i = 0; i < n_dirs; i++) { + for (i = 0; i < module_ndirs; i++) { fname = g_strdup_printf("%s/%s%s", - dirs[i], module_name, CONFIG_HOST_DSOSUF); + module_dirs[i], module_name, CONFIG_HOST_DSOSUF); ret = module_load_file(fname, mayfail, export_symbols); g_free(fname); fname = NULL; @@ -274,10 +288,6 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) g_free(module_name); } - for (i = 0; i < n_dirs; i++) { - g_free(dirs[i]); - } - #endif return success; } From patchwork Thu Jun 10 05:57:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=T7sSTCks; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tsS34thz9s5R for ; Thu, 10 Jun 2021 16:11:40 +1000 (AEST) Received: from localhost ([::1]:53484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDuk-0001py-Ev for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:11:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDjN-0005hG-4G for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26772) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDjL-0002T0-BU for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:59:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=alG6R6cGR+fZFHYt0M7xSOj+2M/4LYU7I+kRHfvTcag=; b=T7sSTCkspkAVgypE4xvtwABrCM2bPbrUN/36IrmjatlEu0SLw4F0cE8hjwDnVhJ3IBVJXv 165hOHhT9FZWUbS0paC7aU8AG0hQ1eGCAg5sjo/stYmydAi77Pa/t0RvDLVfM2j/yucA4B CRDbBOqo4seAKBYfFNJArEXKX1E3b9E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-164-lTcvCa4oMuiPkuEH-dtx2Q-1; Thu, 10 Jun 2021 01:59:49 -0400 X-MC-Unique: lTcvCa4oMuiPkuEH-dtx2Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 47463800D62; Thu, 10 Jun 2021 05:59:48 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C6025D9E2; Thu, 10 Jun 2021 05:59:32 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 040F218017D5; Thu, 10 Jun 2021 07:57:56 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 13/18] modules: load modinfo.json Date: Thu, 10 Jun 2021 07:57:50 +0200 Message-Id: <20210610055755.538119-14-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Load and parse the module info database. Signed-off-by: Gerd Hoffmann --- util/module.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++ util/trace-events | 3 +++ 2 files changed, 57 insertions(+) diff --git a/util/module.c b/util/module.c index 3a2d6dde9734..b0ea8c57d438 100644 --- a/util/module.c +++ b/util/module.c @@ -20,9 +20,16 @@ #include "qemu/queue.h" #include "qemu/module.h" #include "qemu/cutils.h" +#include "qemu/error-report.h" #ifdef CONFIG_MODULE_UPGRADES #include "qemu-version.h" #endif +#include "trace.h" + +#include "qapi/error.h" +#include "qapi/qapi-types-modules.h" +#include "qapi/qapi-visit-modules.h" +#include "qapi/qobject-input-visitor.h" typedef struct ModuleEntry { @@ -111,6 +118,7 @@ void module_call_init(module_init_type type) #ifdef CONFIG_MODULES +static Modules *modinfo; static char *module_dirs[5]; static int module_ndirs; @@ -137,7 +145,52 @@ static void module_load_path_init(void) #endif assert(module_ndirs <= ARRAY_SIZE(module_dirs)); +} +static void module_load_modinfo(void) +{ + char *file, *json; + FILE *fp; + int i, size; + Visitor *v; + Error *errp = NULL; + + if (modinfo) { + return; + } + + for (i = 0; i < module_ndirs; i++) { + file = g_strdup_printf("%s/modinfo.json", module_dirs[i]); + fp = fopen(file, "r"); + if (fp != NULL) { + break; + } + g_free(file); + } + if (NULL == fp) { + warn_report("No modinfo.json file found."); + return; + } else { + trace_module_load_modinfo(file); + } + + fseek(fp, 0, SEEK_END); + size = ftell(fp); + fseek(fp, 0, SEEK_SET); + json = g_malloc0(size + 1); + fread(json, size, 1, fp); + json[size] = 0; + fclose(fp); + + v = qobject_input_visitor_new_str(json, NULL, &errp); + if (errp) { + error_reportf_err(errp, "parse error (%s)", file); + g_free(file); + return; + } + visit_type_Modules(v, NULL, &modinfo, &errp); + visit_free(v); + g_free(file); } static int module_load_file(const char *fname, bool mayfail, bool export_symbols) @@ -269,6 +322,7 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) g_hash_table_add(loaded_modules, module_name); module_load_path_init(); + module_load_modinfo(); for (i = 0; i < module_ndirs; i++) { fname = g_strdup_printf("%s/%s%s", diff --git a/util/trace-events b/util/trace-events index 806cac14a762..8b2afcbd109a 100644 --- a/util/trace-events +++ b/util/trace-events @@ -100,3 +100,6 @@ uffd_create_fd_api_failed(int err) "errno: %i" uffd_create_fd_api_noioctl(uint64_t ioctl_req, uint64_t ioctl_supp) "ioctl_req: 0x%" PRIx64 "ioctl_supp: 0x%" PRIx64 uffd_register_memory_failed(void *addr, uint64_t length, uint64_t mode, int err) "addr: %p length: %" PRIu64 " mode: 0x%" PRIx64 " errno: %i" uffd_unregister_memory_failed(void *addr, uint64_t length, int err) "addr: %p length: %" PRIu64 " errno: %i" + +# module.c +module_load_modinfo(const char *filename) "modinfo %s" From patchwork Thu Jun 10 05:57:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490184 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NTo8nDIw; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tnf0GXNz9s5R for ; Thu, 10 Jun 2021 16:08:22 +1000 (AEST) Received: from localhost ([::1]:44134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDrY-0003gp-1a for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:08:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDjf-0006JQ-SW for qemu-devel@nongnu.org; Thu, 10 Jun 2021 02:00:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDjb-0002jP-LY for qemu-devel@nongnu.org; Thu, 10 Jun 2021 02:00:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ilWJmIOmzE/tV2g6nq5IRz80ZumBraLMUpE9F1YopUI=; b=NTo8nDIwyTvy1wNrSMPUlC1ki4tCQJJ+Q+vxszS526IkbmTJt8NFKfb9MqIPI1617GtnOg fvtikSY/jbBd88gXJvXZ5WFwKgLUrCzYFiJoWCgPxk0PrLMBW2orXqfJFK3DAXenqyCGXa 5jPxPIOAuob3zioDtnfFQ0y2pSG62UM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-556-FR7mNNLmNhidZYaLE01l9g-1; Thu, 10 Jun 2021 02:00:03 -0400 X-MC-Unique: FR7mNNLmNhidZYaLE01l9g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57125107ACF6; Thu, 10 Jun 2021 06:00:02 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72F255D6AD; Thu, 10 Jun 2021 05:59:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0F33918017FD; Thu, 10 Jun 2021 07:57:56 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 14/18] modules: use modinfo for dependencies Date: Thu, 10 Jun 2021 07:57:51 +0200 Message-Id: <20210610055755.538119-15-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Use module database for module dependencies. Drop hard-coded dependency list. Signed-off-by: Gerd Hoffmann --- util/module.c | 55 ++++++++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/util/module.c b/util/module.c index b0ea8c57d438..fd5fc059e14a 100644 --- a/util/module.c +++ b/util/module.c @@ -254,28 +254,6 @@ static int module_load_file(const char *fname, bool mayfail, bool export_symbols out: return ret; } - -static const struct { - const char *name; - const char *dep; -} module_deps[] = { - { "audio-spice", "ui-spice-core" }, - { "chardev-spice", "ui-spice-core" }, - { "hw-display-qxl", "ui-spice-core" }, - { "ui-spice-app", "ui-spice-core" }, - { "ui-spice-app", "chardev-spice" }, - - { "hw-display-virtio-gpu-gl", "hw-display-virtio-gpu" }, - { "hw-display-virtio-gpu-pci-gl", "hw-display-virtio-gpu-pci" }, - { "hw-display-virtio-vga-gl", "hw-display-virtio-vga" }, - -#ifdef CONFIG_OPENGL - { "ui-egl-headless", "ui-opengl" }, - { "ui-gtk", "ui-opengl" }, - { "ui-sdl", "ui-opengl" }, - { "ui-spice-core", "ui-opengl" }, -#endif -}; #endif bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) @@ -289,9 +267,11 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) #endif char *module_name; int i = 0; - int ret, dep; + int ret; bool export_symbols = false; static GHashTable *loaded_modules; + ModuleInfoList *modlist; + strList *sl; if (!g_module_supported()) { fprintf(stderr, "Module is not supported by system.\n"); @@ -304,17 +284,6 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) module_name = g_strdup_printf("%s%s", prefix, lib_name); - for (dep = 0; dep < ARRAY_SIZE(module_deps); dep++) { - if (strcmp(module_name, module_deps[dep].name) == 0) { - /* we depend on another module */ - module_load_one("", module_deps[dep].dep, false); - } - if (strcmp(module_name, module_deps[dep].dep) == 0) { - /* another module depends on us */ - export_symbols = true; - } - } - if (g_hash_table_contains(loaded_modules, module_name)) { g_free(module_name); return true; @@ -324,6 +293,24 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) module_load_path_init(); module_load_modinfo(); + for (modlist = modinfo->list; modlist != NULL; modlist = modlist->next) { + if (modlist->value->has_deps) { + if (strcmp(modlist->value->name, module_name) == 0) { + /* we depend on other module(s) */ + for (sl = modlist->value->deps; sl != NULL; sl = sl->next) { + module_load_one("", sl->value, false); + } + } else { + for (sl = modlist->value->deps; sl != NULL; sl = sl->next) { + if (strcmp(module_name, sl->value) == 0) { + /* another module depends on us */ + export_symbols = true; + } + } + } + } + } + for (i = 0; i < module_ndirs; i++) { fname = g_strdup_printf("%s/%s%s", module_dirs[i], module_name, CONFIG_HOST_DSOSUF); From patchwork Thu Jun 10 05:57:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490186 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=f8wxIA7P; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tqc2BqJz9s5R for ; Thu, 10 Jun 2021 16:10:04 +1000 (AEST) Received: from localhost ([::1]:49564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDtC-0007SZ-B6 for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:10:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDjg-0006KP-5Z for qemu-devel@nongnu.org; Thu, 10 Jun 2021 02:00:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26878) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDjc-0002jf-1u for qemu-devel@nongnu.org; Thu, 10 Jun 2021 02:00:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tG1SibfhZXrEPT8UmEuDwzDuqqlJOstcdT6uPuEc/Gc=; b=f8wxIA7P/JtFHupueoj9rQ+TEIfubJmZVT08EWqB6RI4mHisyEBy771/0E93sly0X+GgF+ aRLdYXj6mj3V5Eua9Ks6S8MS7e0V6KL6TdwlBG9FK+Vgi6rO1LObrlkEzOs7aCIu36pjfL KNPtfPydoqLRtawYTIS4QWvceQo0C98= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-83-qJLHKetPNgi3HSU4tdADkw-1; Thu, 10 Jun 2021 02:00:04 -0400 X-MC-Unique: qJLHKetPNgi3HSU4tdADkw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 767A8802939; Thu, 10 Jun 2021 06:00:02 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BCF2D5D6BA; Thu, 10 Jun 2021 05:59:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1A58218017FE; Thu, 10 Jun 2021 07:57:56 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 15/18] modules: use modinfo for qom load Date: Thu, 10 Jun 2021 07:57:52 +0200 Message-Id: <20210610055755.538119-16-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Use module database to figure which module implements a given QOM type. Drop hard-coded object list. Signed-off-by: Gerd Hoffmann --- util/module.c | 83 +++++++++++++++++++-------------------------------- 1 file changed, 30 insertions(+), 53 deletions(-) diff --git a/util/module.c b/util/module.c index fd5fc059e14a..46bec1cfbec7 100644 --- a/util/module.c +++ b/util/module.c @@ -333,80 +333,57 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) return success; } -/* - * Building devices and other qom objects modular is mostly useful in - * case they have dependencies to external shared libraries, so we can - * cut down the core qemu library dependencies. Which is the case for - * only a very few devices & objects. - * - * So with the expectation that this will be rather the exception than - * the rule and the list will not gain that many entries, go with a - * simple manually maintained list for now. - * - * The list must be sorted by module (module_load_qom_all() needs this). - */ -static struct { - const char *type; - const char *prefix; - const char *module; -} const qom_modules[] = { - { "ccid-card-passthru", "hw-", "usb-smartcard" }, - { "ccid-card-emulated", "hw-", "usb-smartcard" }, - { "usb-redir", "hw-", "usb-redirect" }, - { "qxl-vga", "hw-", "display-qxl" }, - { "qxl", "hw-", "display-qxl" }, - { "virtio-gpu-device", "hw-", "display-virtio-gpu" }, - { "virtio-gpu-gl-device", "hw-", "display-virtio-gpu-gl" }, - { "vhost-user-gpu", "hw-", "display-virtio-gpu" }, - { "virtio-gpu-pci-base", "hw-", "display-virtio-gpu-pci" }, - { "virtio-gpu-pci", "hw-", "display-virtio-gpu-pci" }, - { "virtio-gpu-gl-pci", "hw-", "display-virtio-gpu-pci-gl" }, - { "vhost-user-gpu-pci", "hw-", "display-virtio-gpu-pci" }, - { "virtio-gpu-ccw", "hw-", "s390x-virtio-gpu-ccw" }, - { "virtio-vga-base", "hw-", "display-virtio-vga" }, - { "virtio-vga", "hw-", "display-virtio-vga" }, - { "virtio-vga-gl", "hw-", "display-virtio-vga-gl" }, - { "vhost-user-vga", "hw-", "display-virtio-vga" }, - { "chardev-braille", "chardev-", "baum" }, - { "chardev-spicevmc", "chardev-", "spice" }, - { "chardev-spiceport", "chardev-", "spice" }, -}; +#ifdef CONFIG_MODULES static bool module_loaded_qom_all; void module_load_qom_one(const char *type) { - int i; + ModuleInfoList *modlist; + strList *sl; if (!type) { return; } - for (i = 0; i < ARRAY_SIZE(qom_modules); i++) { - if (strcmp(qom_modules[i].type, type) == 0) { - module_load_one(qom_modules[i].prefix, - qom_modules[i].module, - false); - return; + + module_load_path_init(); + module_load_modinfo(); + + for (modlist = modinfo->list; modlist != NULL; modlist = modlist->next) { + if (!modlist->value->has_objs) { + continue; + } + for (sl = modlist->value->objs; sl != NULL; sl = sl->next) { + if (strcmp(type, sl->value) == 0) { + module_load_one("", modlist->value->name, false); + } } } } void module_load_qom_all(void) { - int i; + ModuleInfoList *modlist; if (module_loaded_qom_all) { return; } - for (i = 0; i < ARRAY_SIZE(qom_modules); i++) { - if (i > 0 && (strcmp(qom_modules[i - 1].module, - qom_modules[i].module) == 0 && - strcmp(qom_modules[i - 1].prefix, - qom_modules[i].prefix) == 0)) { - /* one module implementing multiple types -> load only once */ + + module_load_path_init(); + module_load_modinfo(); + + for (modlist = modinfo->list; modlist != NULL; modlist = modlist->next) { + if (!modlist->value->has_objs) { continue; } - module_load_one(qom_modules[i].prefix, qom_modules[i].module, true); + module_load_one("", modlist->value->name, false); } module_loaded_qom_all = true; } + +#else + +void module_load_qom_one(const char *type) {} +void module_load_qom_all(void) {} + +#endif From patchwork Thu Jun 10 05:57:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OZrbOEI2; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0txj72N3z9s5R for ; Thu, 10 Jun 2021 16:15:20 +1000 (AEST) Received: from localhost ([::1]:58812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDyH-0005cK-7z for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:15:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDk2-0006uB-8W for qemu-devel@nongnu.org; Thu, 10 Jun 2021 02:00:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32065) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDk0-000378-5T for qemu-devel@nongnu.org; Thu, 10 Jun 2021 02:00:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PDsz2/JBhn6AS9awptgZrMDUgUROemDrHVxi/sZ1sds=; b=OZrbOEI2pTITjsVEoTfALcURCt40XazH1+Ws3CthsmLgY9FKNM88DFLMA8Sll2R9F6XX0j Bb2fs91MxutTIDs9cTCJXo3oclEqDeFam0mVnrxQnQgNQjT5VVmrmDO7Wx7tIIUcipDk3T BF0MQxRB1EdliCPkm7BzSqCKgjdeERA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-382-ZHvQHjHuNsKZI_ZtDENVdw-1; Thu, 10 Jun 2021 02:00:21 -0400 X-MC-Unique: ZHvQHjHuNsKZI_ZtDENVdw-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7588919200C0; Thu, 10 Jun 2021 06:00:20 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C212960C05; Thu, 10 Jun 2021 06:00:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 28EDD1801ABD; Thu, 10 Jun 2021 07:57:56 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 16/18] modules: use modinfo for qemu opts load Date: Thu, 10 Jun 2021 07:57:53 +0200 Message-Id: <20210610055755.538119-17-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Use module database to figure which module adds given QemuOpts group. Signed-off-by: Gerd Hoffmann --- softmmu/vl.c | 17 ----------------- stubs/module-opts.c | 4 ---- util/module.c | 19 +++++++++++++++++++ 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 326c1e908008..ba26a042b284 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2675,23 +2675,6 @@ void qmp_x_exit_preconfig(Error **errp) } } -#ifdef CONFIG_MODULES -void qemu_load_module_for_opts(const char *group) -{ - static bool spice_tried; - if (g_str_equal(group, "spice") && !spice_tried) { - ui_module_load_one("spice-core"); - spice_tried = true; - } - - static bool iscsi_tried; - if (g_str_equal(group, "iscsi") && !iscsi_tried) { - block_module_load_one("iscsi"); - iscsi_tried = true; - } -} -#endif - void qemu_init(int argc, char **argv, char **envp) { QemuOpts *opts; diff --git a/stubs/module-opts.c b/stubs/module-opts.c index a7d0e4ad6ead..5412429ea869 100644 --- a/stubs/module-opts.c +++ b/stubs/module-opts.c @@ -1,6 +1,2 @@ #include "qemu/osdep.h" #include "qemu/config-file.h" - -void qemu_load_module_for_opts(const char *group) -{ -} diff --git a/util/module.c b/util/module.c index 46bec1cfbec7..6e4199169c41 100644 --- a/util/module.c +++ b/util/module.c @@ -21,6 +21,7 @@ #include "qemu/module.h" #include "qemu/cutils.h" #include "qemu/error-report.h" +#include "qemu/config-file.h" #ifdef CONFIG_MODULE_UPGRADES #include "qemu-version.h" #endif @@ -381,8 +382,26 @@ void module_load_qom_all(void) module_loaded_qom_all = true; } +void qemu_load_module_for_opts(const char *group) +{ + ModuleInfoList *modlist; + + module_load_path_init(); + module_load_modinfo(); + + for (modlist = modinfo->list; modlist != NULL; modlist = modlist->next) { + if (!modlist->value->has_opts) { + continue; + } + if (strcmp(modlist->value->opts, group) == 0) { + module_load_one("", modlist->value->name, false); + } + } +} + #else +void qemu_load_module_for_opts(const char *group) {} void module_load_qom_one(const char *type) {} void module_load_qom_all(void) {} From patchwork Thu Jun 10 05:57:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490176 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fgMFDrZx; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tfB657qz9s5R for ; Thu, 10 Jun 2021 16:01:54 +1000 (AEST) Received: from localhost ([::1]:52844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDlI-0007MH-Ph for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:01:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDjv-0006YF-MC for qemu-devel@nongnu.org; Thu, 10 Jun 2021 02:00:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42331) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDjt-00031R-3M for qemu-devel@nongnu.org; Thu, 10 Jun 2021 02:00:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3NHf57mrDF/lAB4juE+vhNL48eofDl6lruw1cSPZxXo=; b=fgMFDrZxZGMf8LNLbJExYq6cHiGlzTzoE3DupGAQhRLpvb97WaWA/0mBOmrfg/dHEn/fIK 5YPEJ8INwwA8A03Bj0JopDAC4w/qZSV3/fgutxVJxLje1bRN7u8AKTi/TEHg8R3Z15P9eU UNg/sC9gqy6MB4SYRM9CfFbXS7PwcNU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-429-WXnj142gP9aHaGB9F6fgYw-1; Thu, 10 Jun 2021 02:00:22 -0400 X-MC-Unique: WXnj142gP9aHaGB9F6fgYw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C1EC0101C8B3; Thu, 10 Jun 2021 06:00:20 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EDF1119CBF; Thu, 10 Jun 2021 06:00:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3774C1801ABE; Thu, 10 Jun 2021 07:57:56 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 17/18] modules: check arch and block load on mismatch Date: Thu, 10 Jun 2021 07:57:54 +0200 Message-Id: <20210610055755.538119-18-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add module_allow_arch() to set the target architecture. In case a module is limited to some arch verify arches match and ignore the module if not. Signed-off-by: Gerd Hoffmann --- include/qemu/module.h | 1 + softmmu/vl.c | 3 +++ util/module.c | 15 +++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/include/qemu/module.h b/include/qemu/module.h index d3cab3c25a2f..7825f6d8c847 100644 --- a/include/qemu/module.h +++ b/include/qemu/module.h @@ -72,6 +72,7 @@ void module_call_init(module_init_type type); bool module_load_one(const char *prefix, const char *lib_name, bool mayfail); void module_load_qom_one(const char *type); void module_load_qom_all(void); +void module_allow_arch(const char *arch); /* * macros to store module metadata in a .modinfo section. diff --git a/softmmu/vl.c b/softmmu/vl.c index ba26a042b284..96316774fcc9 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -126,6 +126,8 @@ #include "sysemu/iothread.h" #include "qemu/guest-random.h" +#include "config-host.h" + #define MAX_VIRTIO_CONSOLES 1 typedef struct BlockdevOptionsQueueEntry { @@ -2723,6 +2725,7 @@ void qemu_init(int argc, char **argv, char **envp) error_init(argv[0]); qemu_init_exec_dir(argv[0]); + module_allow_arch(TARGET_NAME); qemu_init_subsystems(); /* first pass of option parsing */ diff --git a/util/module.c b/util/module.c index 6e4199169c41..564b8e3da760 100644 --- a/util/module.c +++ b/util/module.c @@ -122,6 +122,12 @@ void module_call_init(module_init_type type) static Modules *modinfo; static char *module_dirs[5]; static int module_ndirs; +static const char *module_arch; + +void module_allow_arch(const char *arch) +{ + module_arch = arch; +} static void module_load_path_init(void) { @@ -295,6 +301,14 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) module_load_modinfo(); for (modlist = modinfo->list; modlist != NULL; modlist = modlist->next) { + if (modlist->value->has_arch) { + if (strcmp(modlist->value->name, module_name) == 0) { + if (!module_arch || + strcmp(modlist->value->arch, module_arch) != 0) { + return false; + } + } + } if (modlist->value->has_deps) { if (strcmp(modlist->value->name, module_name) == 0) { /* we depend on other module(s) */ @@ -401,6 +415,7 @@ void qemu_load_module_for_opts(const char *group) #else +void module_allow_arch(const char *arch) {} void qemu_load_module_for_opts(const char *group) {} void module_load_qom_one(const char *type) {} void module_load_qom_all(void) {} From patchwork Thu Jun 10 05:57:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490190 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AQoSQkIF; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G0tzk1QnMz9s5R for ; Thu, 10 Jun 2021 16:17:06 +1000 (AEST) Received: from localhost ([::1]:33232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrE00-0007XS-3k for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 02:17:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDk9-0007Dd-MB for qemu-devel@nongnu.org; Thu, 10 Jun 2021 02:00:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDk7-0003C6-EL for qemu-devel@nongnu.org; Thu, 10 Jun 2021 02:00:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623304838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/7QuZN5frE4KlaTOtmTx8UaotmNF9mPVuO1gZv6vakQ=; b=AQoSQkIFNTlWEw8KuETUqUX3QN8Le9Lu+T6+HtzsNHiNV7A13bEVniyyOLap4BQkn6Y27C nOPhlXAiFRoV7jR3sD6tpnkB0XcZoYJdQH5dUq4ILgMJ3OBAjZPbf+IEGMtzz3KTVawGns Unl9fLeSxYWLWx8NB0nto+Czgay0m2o= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-487-Pl3SyuPhNbCkKsDuH2aC1Q-1; Thu, 10 Jun 2021 02:00:36 -0400 X-MC-Unique: Pl3SyuPhNbCkKsDuH2aC1Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 51E68100C660; Thu, 10 Jun 2021 06:00:34 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-69.ams2.redhat.com [10.36.113.69]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E55AD19C46; Thu, 10 Jun 2021 06:00:21 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 421FA1803094; Thu, 10 Jun 2021 07:57:56 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 18/18] [fixup] module_load_modinfo Date: Thu, 10 Jun 2021 07:57:55 +0200 Message-Id: <20210610055755.538119-19-kraxel@redhat.com> In-Reply-To: <20210610055755.538119-1-kraxel@redhat.com> References: <20210610055755.538119-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: Kevin Wolf , Thomas Huth , berrange@redhat.com, qemu-block@nongnu.org, "Michael S. Tsirkin" , Michael Roth , Cornelia Huck , Peter Lieven , Markus Armbruster , Max Reitz , Halil Pasic , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-s390x@nongnu.org, Gerd Hoffmann , Ronnie Sahlberg , Samuel Thibault , Paolo Bonzini , David Hildenbrand , Richard Henderson , Eric Blake , Christian Borntraeger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann --- util/module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/module.c b/util/module.c index 564b8e3da760..4f98cc74ae37 100644 --- a/util/module.c +++ b/util/module.c @@ -158,7 +158,7 @@ static void module_load_modinfo(void) { char *file, *json; FILE *fp; - int i, size; + int i, size, ret; Visitor *v; Error *errp = NULL; @@ -185,8 +185,8 @@ static void module_load_modinfo(void) size = ftell(fp); fseek(fp, 0, SEEK_SET); json = g_malloc0(size + 1); - fread(json, size, 1, fp); - json[size] = 0; + ret = fread(json, 1, size, fp); + json[ret] = 0; fclose(fp); v = qobject_input_visitor_new_str(json, NULL, &errp);