From patchwork Thu Jun 10 05:57:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 1490172 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=DEIz7d/o; 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 4G0tZj3rFjz9s5R for ; Thu, 10 Jun 2021 15:58:52 +1000 (AEST) Received: from localhost ([::1]:44558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrDiK-0001ad-Im for incoming@patchwork.ozlabs.org; Thu, 10 Jun 2021 01:58:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDhx-0001ZF-Ab for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:58:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrDht-0001BE-UA for qemu-devel@nongnu.org; Thu, 10 Jun 2021 01:58:25 -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; bh=G2tExqMXRIXSmac4/JZ3SITLE4OjB02gEhOmdlB93rA=; b=DEIz7d/o8IlPFrY/el8+P5IvJZjWP09iwyK63MlIUYEY3wi6TuniTIpjJJgI07+doR/NDZ i4EjouxmOhNfwoeuzpPhaEQjrAnlEYpY5e2EyW97BuOlzlaqsoI90b8ql8274jIG6LxlPn G7MTg/XWyfgxutTLRuy+YwrXTkvp9V4= 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-162-Rswlrd1JP8OZzsCVjuXUJA-1; Thu, 10 Jun 2021 01:58:18 -0400 X-MC-Unique: Rswlrd1JP8OZzsCVjuXUJA-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 B219619200C1; Thu, 10 Jun 2021 05:58: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 91D7360C05; Thu, 10 Jun 2021 05:57:56 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3A88418000B2; Thu, 10 Jun 2021 07:57:55 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 00/18] modules: add metadata database Date: Thu, 10 Jun 2021 07:57:37 +0200 Message-Id: <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" This patch series adds support for module metadata. Here are the pieces of the puzzle: (1) Macros are added to store metadata in a .modinfo elf section (idea stolen from the linux kernel). (2) A utility to scan modules, collect metadata from the .modinfo sections, store it in a file (modinfo.json) for later consumption by qemu. Can also be easily inspected using 'jq'. (3) Adding annotations to the modules we have. (4) Drop hard-coded lists from utils/module.c take care, Gerd Gerd Hoffmann (18): modules: add metadata macros, add qxl module annotations qapi: add ModuleInfo schema modules: add qemu-modinfo utility modules: add virtio-gpu module annotations modules: add chardev module annotations modules: add audio module annotations modules: add usb-redir module annotations modules: add ccid module annotations modules: add ui module annotations modules: add s390x module annotations modules: add block module annotations modules: add module_load_path_init helper modules: load modinfo.json modules: use modinfo for dependencies modules: use modinfo for qom load modules: use modinfo for qemu opts load modules: check arch and block load on mismatch [fixup] module_load_modinfo include/qemu/module.h | 23 +++ audio/spiceaudio.c | 2 + block/iscsi-opts.c | 1 + chardev/baum.c | 1 + chardev/spice.c | 4 + hw/display/qxl.c | 4 + 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 + hw/s390x/virtio-ccw-gpu.c | 3 + hw/usb/ccid-card-emulated.c | 1 + hw/usb/ccid-card-passthru.c | 1 + hw/usb/redirect.c | 1 + qemu-modinfo.c | 270 ++++++++++++++++++++++++++++++ softmmu/vl.c | 20 +-- stubs/module-opts.c | 4 - ui/egl-headless.c | 4 + ui/gtk.c | 4 + ui/sdl2.c | 4 + ui/spice-app.c | 3 + ui/spice-core.c | 5 + util/module.c | 282 +++++++++++++++++++------------- meson.build | 11 ++ qapi/meson.build | 1 + qapi/modules.json | 36 ++++ qapi/qapi-schema.json | 1 + util/trace-events | 3 + 34 files changed, 576 insertions(+), 131 deletions(-) create mode 100644 qemu-modinfo.c create mode 100644 qapi/modules.json