From patchwork Wed Jun 24 13:10:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11623103 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 242E860D for ; Wed, 24 Jun 2020 13:12:11 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CC58C20720 for ; Wed, 24 Jun 2020 13:12:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="K8rwzL4S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC58C20720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:53370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo5CD-0003yu-L4 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 09:12:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo5B7-0002CH-5o for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:01 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:54526 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jo5B4-0001Qx-RL for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593004257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=8BfVD+OM03DL0qt0nib4hII2g9y5qCUmWKTWek7P/5g=; b=K8rwzL4SbraliT2kN0DLd01lU0KE5WS7f2Q1H8gUSEpmMHjJe9hEN7jQdbTd54JXWQ9x+4 01Upexe1bzNwgmSuAmXyNMcKQnJ8XRHvyjEfdH9asgOIlBfcvHcUFyefjDVnBmfTqj1tXG e8enzdRmX9T1CzE5MmWRJxkg0+E4nBg= 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-418-1u_3mIegP4O6gYxKnMFh-Q-1; Wed, 24 Jun 2020 09:10:55 -0400 X-MC-Unique: 1u_3mIegP4O6gYxKnMFh-Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DDC98805EE3 for ; Wed, 24 Jun 2020 13:10:54 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8170317514; Wed, 24 Jun 2020 13:10:46 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9D1C845DB; Wed, 24 Jun 2020 15:10:45 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v5 01/10] module: qom module support Date: Wed, 24 Jun 2020 15:10:36 +0200 Message-Id: <20200624131045.14512-2-kraxel@redhat.com> In-Reply-To: <20200624131045.14512-1-kraxel@redhat.com> References: <20200624131045.14512-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 03:27:53 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , dinechin@redhat.com, Paolo Bonzini , philmd@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add support for qom types provided by modules. For starters use a manually maintained list which maps qom type to module and prefix. Two load functions are added: One to load the module for a specific type, and one to load all modules (needed for object/device lists as printed by -- for example -- qemu -device help). Signed-off-by: Gerd Hoffmann --- include/qemu/module.h | 2 ++ util/module.c | 55 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/include/qemu/module.h b/include/qemu/module.h index 011ae1ae7605..9121a475c1b6 100644 --- a/include/qemu/module.h +++ b/include/qemu/module.h @@ -70,5 +70,7 @@ void register_dso_module_init(void (*fn)(void), module_init_type type); void module_call_init(module_init_type type); bool module_load_one(const char *prefix, const char *lib_name); +void module_load_qom_one(const char *type); +void module_load_qom_all(void); #endif diff --git a/util/module.c b/util/module.c index e48d9aacc05a..ee560a4b4269 100644 --- a/util/module.c +++ b/util/module.c @@ -245,3 +245,58 @@ bool module_load_one(const char *prefix, const char *lib_name) #endif 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 + * to rule and the list will not gain that many entries go with a + * simple manually maintained list for now. + */ +static struct { + const char *type; + const char *prefix; + const char *module; +} const qom_modules[] = { +}; + +static bool module_loaded_qom_all; + +void module_load_qom_one(const char *type) +{ + int i; + + if (module_loaded_qom_all) { + 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); + return; + } + } +} + +void module_load_qom_all(void) +{ + int i; + + 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 */ + continue; + } + module_load_one(qom_modules[i].prefix, qom_modules[i].module); + } + module_loaded_qom_all = true; +} From patchwork Wed Jun 24 13:10:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11623117 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1820138C for ; Wed, 24 Jun 2020 13:14:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9965820857 for ; Wed, 24 Jun 2020 13:14:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JvI6YyAn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9965820857 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:33668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo5EJ-0007Rt-Sa for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 09:14:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo5B9-0002IJ-LX for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:03 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:38277 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jo5B7-0001TS-8Z for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593004260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=3JjolbAfJRYmpL2My7tEOtXnKfwWbmvHJVH2SMKlGHw=; b=JvI6YyAns6dEUI8/V3PDF5Q41QjZT8TvP91mrB5WsXwMJ4AOdosg4kSLbu4cMkQetU8vli oZm9Lv5MlEnu0wiKxqF9gkDJRMZrwndn8Dz6oOCUoZFUEA6OTvCLX1QGYR9Gt3pytO4yov btgP3Ks0aGZzdCJzXDNJC7QyPc28/Y0= 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-418-BGTmQUNFNQyoLgN9gOb8tw-1; Wed, 24 Jun 2020 09:10:55 -0400 X-MC-Unique: BGTmQUNFNQyoLgN9gOb8tw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EB3101005513 for ; Wed, 24 Jun 2020 13:10:54 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8169B5C240; Wed, 24 Jun 2020 13:10:46 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A799097DC; Wed, 24 Jun 2020 15:10:45 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v5 02/10] object: qom module support Date: Wed, 24 Jun 2020 15:10:37 +0200 Message-Id: <20200624131045.14512-3-kraxel@redhat.com> In-Reply-To: <20200624131045.14512-1-kraxel@redhat.com> References: <20200624131045.14512-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 03:27:53 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , dinechin@redhat.com, Paolo Bonzini , philmd@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Little helper function to load modules on demand. In most cases adding module loading support for devices and other objects is just s/object_class_by_name/module_object_class_by_name/ in the right spot. Signed-off-by: Gerd Hoffmann --- include/qom/object.h | 12 ++++++++++++ qom/object.c | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index 94a61ccc3fe8..51f188137f1f 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -994,6 +994,18 @@ bool object_class_is_abstract(ObjectClass *klass); */ ObjectClass *object_class_by_name(const char *typename); +/** + * module_object_class_by_name: + * @typename: The QOM typename to obtain the class for. + * + * For objects which might be provided by a module. Behaves like + * object_class_by_name, but additionally tries to load the module + * needed in case the class is not available. + * + * Returns: The class for @typename or %NULL if not found. + */ +ObjectClass *module_object_class_by_name(const char *typename); + void object_class_foreach(void (*fn)(ObjectClass *klass, void *opaque), const char *implements_type, bool include_abstract, void *opaque); diff --git a/qom/object.c b/qom/object.c index 6ece96bc2bfc..34daaf1280f5 100644 --- a/qom/object.c +++ b/qom/object.c @@ -985,6 +985,20 @@ ObjectClass *object_class_by_name(const char *typename) return type->class; } +ObjectClass *module_object_class_by_name(const char *typename) +{ + ObjectClass *oc; + + oc = object_class_by_name(typename); +#ifdef CONFIG_MODULES + if (!oc) { + module_load_qom_one(typename); + oc = object_class_by_name(typename); + } +#endif + return oc; +} + ObjectClass *object_class_get_parent(ObjectClass *class) { TypeImpl *type = type_get_parent(class->type); From patchwork Wed Jun 24 13:10:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11623129 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E85C160D for ; Wed, 24 Jun 2020 13:15:03 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C018820E65 for ; Wed, 24 Jun 2020 13:15:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Gxu7cECB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C018820E65 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo5F0-0000Eb-Qf for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 09:15:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo5BB-0002Oo-Sl for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:05 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:58851 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jo5B5-0001S7-H3 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593004258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=3arQYzUakvsEsZj46IHWx5U5R2JTza3tPTR92n9R/ag=; b=Gxu7cECBpMDp7ei5WpAK20IEnFpsj0iHft76pMSYgBnUm/0yu3VA9Kjho0hP039nEgQJpR 6845u9pBkLsdVU7Zxt5IWSbjSzrlUHXwiIuadlUPc9hsULyXJ8HEBltn98XNY1WHTi0QRb E67WwwnjLMBCdmPv+JTNeBd64VpmaTs= 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-174-juzJG9ksMGWUmeYhD7FfrA-1; Wed, 24 Jun 2020 09:10:56 -0400 X-MC-Unique: juzJG9ksMGWUmeYhD7FfrA-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 B7B63805EE5 for ; Wed, 24 Jun 2020 13:10:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 818A979317; Wed, 24 Jun 2020 13:10:46 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B530D59CC; Wed, 24 Jun 2020 15:10:45 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v5 03/10] qdev: device module support Date: Wed, 24 Jun 2020 15:10:38 +0200 Message-Id: <20200624131045.14512-4-kraxel@redhat.com> In-Reply-To: <20200624131045.14512-1-kraxel@redhat.com> References: <20200624131045.14512-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 03:27:53 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , dinechin@redhat.com, Paolo Bonzini , philmd@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Hook module loading into the places where we need it when building devices as modules. Signed-off-by: Gerd Hoffmann --- hw/core/qdev.c | 6 ++++-- qdev-monitor.c | 5 +++-- qom/qom-qmp-cmds.c | 3 ++- softmmu/vl.c | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 2131c7f951dd..9de16eae05b7 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -137,6 +137,9 @@ void qdev_set_parent_bus(DeviceState *dev, BusState *bus) */ DeviceState *qdev_new(const char *name) { + if (!object_class_by_name(name)) { + module_load_qom_one(name); + } return DEVICE(object_new(name)); } @@ -147,10 +150,9 @@ DeviceState *qdev_new(const char *name) */ DeviceState *qdev_try_new(const char *name) { - if (!object_class_by_name(name)) { + if (!module_object_class_by_name(name)) { return NULL; } - return DEVICE(object_new(name)); } diff --git a/qdev-monitor.c b/qdev-monitor.c index 22da107484c5..8e7a7f7bbdbc 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -147,6 +147,7 @@ static void qdev_print_devinfos(bool show_no_user) int i; bool cat_printed; + module_load_qom_all(); list = object_class_get_list_sorted(TYPE_DEVICE, false); for (i = 0; i <= DEVICE_CATEGORY_MAX; i++) { @@ -215,13 +216,13 @@ static DeviceClass *qdev_get_device_class(const char **driver, Error **errp) DeviceClass *dc; const char *original_name = *driver; - oc = object_class_by_name(*driver); + oc = module_object_class_by_name(*driver); if (!oc) { const char *typename = find_typename_by_alias(*driver); if (typename) { *driver = typename; - oc = object_class_by_name(*driver); + oc = module_object_class_by_name(*driver); } } diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index c5249e44d020..5e2c8cbf333f 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -116,6 +116,7 @@ ObjectTypeInfoList *qmp_qom_list_types(bool has_implements, { ObjectTypeInfoList *ret = NULL; + module_load_qom_all(); object_class_foreach(qom_list_types_tramp, implements, abstract, &ret); return ret; @@ -130,7 +131,7 @@ ObjectPropertyInfoList *qmp_device_list_properties(const char *typename, ObjectPropertyIterator iter; ObjectPropertyInfoList *prop_list = NULL; - klass = object_class_by_name(typename); + klass = module_object_class_by_name(typename); if (klass == NULL) { error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found", typename); diff --git a/softmmu/vl.c b/softmmu/vl.c index f669c06ede4a..1297815a5f5b 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1772,8 +1772,8 @@ static bool vga_interface_available(VGAInterfaceType t) assert(t < VGA_TYPE_MAX); return !ti->class_names[0] || - object_class_by_name(ti->class_names[0]) || - object_class_by_name(ti->class_names[1]); + module_object_class_by_name(ti->class_names[0]) || + module_object_class_by_name(ti->class_names[1]); } static const char * From patchwork Wed Jun 24 13:10:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11623105 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A9474138C for ; Wed, 24 Jun 2020 13:12:12 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7DED720786 for ; Wed, 24 Jun 2020 13:12:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TmgnF2GP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DED720786 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:53584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo5CF-00044E-ND for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 09:12:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo5B8-0002EA-Do for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:02 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:20293 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jo5B6-0001Sd-If for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593004259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=4+/WITPq33oOuq4ULbgpiAQx/AA+X0qzxS870TvpddY=; b=TmgnF2GP8NfAklAsD5vnrWdsVJrwzW7iGnm33GlSyHWvVS36l2oSbthHlzqWP/T4qiO7rI nqT1qbQqiLM8C9zL4YP6AstPW24gucaFTmeQvo7bEIp1ulyoszqwmUcpdYqnPiZAp1nBEN rnnaIQlEvVMTMe5pb8kZUJO7l0n1X5Y= 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-255-Q7Dnhzm2Mg2jEvVEJ8q_vw-1; Wed, 24 Jun 2020 09:10:55 -0400 X-MC-Unique: Q7Dnhzm2Mg2jEvVEJ8q_vw-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 CC87B18A8220 for ; Wed, 24 Jun 2020 13:10:54 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C2BC1A8F7; Wed, 24 Jun 2020 13:10:46 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BE3466DE2; Wed, 24 Jun 2020 15:10:45 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v5 04/10] build: fix device module builds Date: Wed, 24 Jun 2020 15:10:39 +0200 Message-Id: <20200624131045.14512-5-kraxel@redhat.com> In-Reply-To: <20200624131045.14512-1-kraxel@redhat.com> References: <20200624131045.14512-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 01:59:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , dinechin@redhat.com, Paolo Bonzini , philmd@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" See comment. Feels quite hackish. Better ideas anyone? Signed-off-by: Gerd Hoffmann --- Makefile.target | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile.target b/Makefile.target index 8ed1eba95b9c..c70325df5796 100644 --- a/Makefile.target +++ b/Makefile.target @@ -179,6 +179,13 @@ endif # CONFIG_SOFTMMU dummy := $(call unnest-vars,,obj-y) all-obj-y := $(obj-y) +# +# common-obj-m has some crap here, probably as side effect from +# filling obj-y. Clear it. Fixes suspious dependency errors when +# building devices as modules. +# +common-obj-m := + include $(SRC_PATH)/Makefile.objs dummy := $(call unnest-vars,.., \ authz-obj-y \ From patchwork Wed Jun 24 13:10:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11623115 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B14A760D for ; Wed, 24 Jun 2020 13:14:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 87D0520720 for ; Wed, 24 Jun 2020 13:14:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FJ1iBAEk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87D0520720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:33724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo5EJ-0007TB-QW for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 09:14:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo5B9-0002J0-Td for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:03 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20511 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jo5B7-0001TV-BJ for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593004260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=74AeFL074gpoAQc1Wc6wYwTr1cYk2s3cOeuzBhmYolM=; b=FJ1iBAEkRK2hMNHwubu1d7hYjVsszWWQR6JRSRFTGzHI2Nx41nlCDrCkwOMzZfwIb9iDoR BFqlI7JIeaHjH7aOsLfZE8zL9K1OkdNdXWF8IpBPQLBnX4h+Wknqhjo35+TmC8lm4OM94d B4TzKdzrRE7XNhoEYiCTQsKZNoPHUqk= 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-101-6-bqQfVCOBGpEICBn-sx5A-1; Wed, 24 Jun 2020 09:10:56 -0400 X-MC-Unique: 6-bqQfVCOBGpEICBn-sx5A-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 1082E805EE6 for ; Wed, 24 Jun 2020 13:10:56 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id B981F2B47C; Wed, 24 Jun 2020 13:10:55 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CB4AF6DE4; Wed, 24 Jun 2020 15:10:45 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v5 05/10] ccid: build smartcard as module Date: Wed, 24 Jun 2020 15:10:40 +0200 Message-Id: <20200624131045.14512-6-kraxel@redhat.com> In-Reply-To: <20200624131045.14512-1-kraxel@redhat.com> References: <20200624131045.14512-1-kraxel@redhat.com> 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=207.211.31.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 02:33:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , dinechin@redhat.com, Paolo Bonzini , philmd@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Drops libcacard.so dependency from core qemu. Signed-off-by: Gerd Hoffmann --- Makefile.objs | 1 + util/module.c | 2 ++ hw/Makefile.objs | 1 + hw/usb/Makefile.objs | 4 +++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.objs b/Makefile.objs index 7ce2588b89a3..ca555ede0710 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -59,6 +59,7 @@ common-obj-y += migration/ common-obj-y += audio/ common-obj-m += audio/ common-obj-y += hw/ +common-obj-m += hw/ common-obj-y += replay/ diff --git a/util/module.c b/util/module.c index ee560a4b4269..89da9a3cce05 100644 --- a/util/module.c +++ b/util/module.c @@ -261,6 +261,8 @@ static struct { const char *prefix; const char *module; } const qom_modules[] = { + { "ccid-card-passthru", "hw-", "usb-smartcard" }, + { "ccid-card-emulated", "hw-", "usb-smartcard" }, }; static bool module_loaded_qom_all; diff --git a/hw/Makefile.objs b/hw/Makefile.objs index 4cbe5e4e57d6..af8fd9a510ed 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -43,4 +43,5 @@ devices-dirs-y += smbios/ endif common-obj-y += $(devices-dirs-y) +common-obj-m += usb/ obj-y += $(devices-dirs-y) diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs index fa5c3fa1b877..3c5b3d4fadd3 100644 --- a/hw/usb/Makefile.objs +++ b/hw/usb/Makefile.objs @@ -29,11 +29,13 @@ common-obj-$(CONFIG_USB_NETWORK) += dev-network.o ifeq ($(CONFIG_USB_SMARTCARD),y) common-obj-y += dev-smartcard-reader.o -common-obj-$(CONFIG_SMARTCARD) += smartcard.mo +ifeq ($(CONFIG_SMARTCARD),y) +common-obj-m += smartcard.mo smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o smartcard.mo-cflags := $(SMARTCARD_CFLAGS) smartcard.mo-libs := $(SMARTCARD_LIBS) endif +endif ifeq ($(CONFIG_POSIX),y) common-obj-$(CONFIG_USB_STORAGE_MTP) += dev-mtp.o From patchwork Wed Jun 24 13:10:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11623143 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5040960D for ; Wed, 24 Jun 2020 13:16:16 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2840620720 for ; Wed, 24 Jun 2020 13:16:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="APLgU+dz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2840620720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:41476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo5GB-0002LQ-ES for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 09:16:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo5BB-0002Ms-92 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:05 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:54572 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jo5B9-0001UG-Fa for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593004262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=REtVIWqECp2RF/bhZhco8JE7WwVgyZrlNd3wZE3Hf70=; b=APLgU+dzJt5gccn8okYK+ngKEzNr8Po0cF3WNdOwd6Ax+1zktxd9yGAejNXjo1ri197uh5 sMln6Dtof0eggB915Yx2QJraXoOdnCUQCbPqAnIB3DYtpoBsNSCOJp2VM4yE5kLQ7NkiZF VKUT7pv4YlNKd8687tbph1ad+15/Zho= 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-321-sq4IGbjyM36kvOsl7w-C2Q-1; Wed, 24 Jun 2020 09:10:56 -0400 X-MC-Unique: sq4IGbjyM36kvOsl7w-C2Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1A290805EE1 for ; Wed, 24 Jun 2020 13:10:56 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id C47885C660; Wed, 24 Jun 2020 13:10:55 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D577859D8; Wed, 24 Jun 2020 15:10:45 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v5 06/10] usb: build usb-redir as module Date: Wed, 24 Jun 2020 15:10:41 +0200 Message-Id: <20200624131045.14512-7-kraxel@redhat.com> In-Reply-To: <20200624131045.14512-1-kraxel@redhat.com> References: <20200624131045.14512-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 01:59:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , dinechin@redhat.com, Paolo Bonzini , philmd@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Drops libusbredirparser.so dependency from core qemu. Signed-off-by: Gerd Hoffmann Reviewed-by: Christophe de Dinechin --- util/module.c | 1 + hw/usb/Makefile.objs | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/util/module.c b/util/module.c index 89da9a3cce05..e3226165e91c 100644 --- a/util/module.c +++ b/util/module.c @@ -263,6 +263,7 @@ static struct { } const qom_modules[] = { { "ccid-card-passthru", "hw-", "usb-smartcard" }, { "ccid-card-emulated", "hw-", "usb-smartcard" }, + { "usb-redir", "hw-", "usb-redirect" }, }; static bool module_loaded_qom_all; diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs index 3c5b3d4fadd3..e342ff59fab0 100644 --- a/hw/usb/Makefile.objs +++ b/hw/usb/Makefile.objs @@ -43,9 +43,12 @@ endif # usb redirection ifeq ($(CONFIG_USB),y) -common-obj-$(CONFIG_USB_REDIR) += redirect.o quirks.o -redirect.o-cflags = $(USB_REDIR_CFLAGS) -redirect.o-libs = $(USB_REDIR_LIBS) +ifeq ($(CONFIG_USB_REDIR),y) +common-obj-m += redirect.mo +redirect.mo-objs = redirect.o quirks.o +redirect.mo-cflags = $(USB_REDIR_CFLAGS) +redirect.mo-libs = $(USB_REDIR_LIBS) +endif endif # usb pass-through From patchwork Wed Jun 24 13:10:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11623145 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35530138C for ; Wed, 24 Jun 2020 13:17:52 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EC1E320857 for ; Wed, 24 Jun 2020 13:17:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bI/Fis5g" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC1E320857 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:47320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo5Hj-0004wy-7L for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 09:17:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo5BI-0002iU-R2 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:12 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:45474) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jo5BH-0001Wx-2A for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593004270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=RuiijUWj1ZCPXbzPBVaOwDx7Q4COaTIHHfreG3eeExc=; b=bI/Fis5gfwDhnX4tY1Aa/Klimd+di1XTUa5ESyfiRBQR7Y7D7Ue/Wju23DT9dyzfw7Apvp TKP77ocRFFLDHhDXDxWp7E6cMiqiBOidO2dL6iDdBmmCkm8NKAv8Ru9qgb62Zki+bSfrrn KGwgWz2nCYNn+vZ17w+w+8+l1XFHwAM= 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-2-io9uhg0VMjCDwX7yjBktyA-1; Wed, 24 Jun 2020 09:11:06 -0400 X-MC-Unique: io9uhg0VMjCDwX7yjBktyA-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 D3E2810059A0 for ; Wed, 24 Jun 2020 13:11:04 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD16610016DA; Wed, 24 Jun 2020 13:10:55 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id E11D831E22; Wed, 24 Jun 2020 15:10:45 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v5 07/10] vga: build qxl as module Date: Wed, 24 Jun 2020 15:10:42 +0200 Message-Id: <20200624131045.14512-8-kraxel@redhat.com> In-Reply-To: <20200624131045.14512-1-kraxel@redhat.com> References: <20200624131045.14512-1-kraxel@redhat.com> 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=205.139.110.61; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 00:34:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , dinechin@redhat.com, Paolo Bonzini , philmd@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" First step in making spice support modular. Signed-off-by: Gerd Hoffmann Reviewed-by: Christophe de Dinechin --- util/module.c | 2 ++ hw/Makefile.objs | 1 + hw/display/Makefile.objs | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/util/module.c b/util/module.c index e3226165e91c..7c76d2a84b94 100644 --- a/util/module.c +++ b/util/module.c @@ -264,6 +264,8 @@ static struct { { "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" }, }; static bool module_loaded_qom_all; diff --git a/hw/Makefile.objs b/hw/Makefile.objs index af8fd9a510ed..14b7ea4eb62e 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -43,5 +43,6 @@ devices-dirs-y += smbios/ endif common-obj-y += $(devices-dirs-y) +common-obj-m += display/ common-obj-m += usb/ obj-y += $(devices-dirs-y) diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs index 77a7d622bd2d..76b3571e4902 100644 --- a/hw/display/Makefile.objs +++ b/hw/display/Makefile.objs @@ -44,7 +44,10 @@ common-obj-$(CONFIG_ARTIST) += artist.o obj-$(CONFIG_VGA) += vga.o -common-obj-$(CONFIG_QXL) += qxl.o qxl-logger.o qxl-render.o +ifeq ($(CONFIG_QXL),y) +common-obj-m += qxl.mo +qxl.mo-objs = qxl.o qxl-logger.o qxl-render.o +endif obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o From patchwork Wed Jun 24 13:10:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11623121 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DCED260D for ; Wed, 24 Jun 2020 13:14:37 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B46E120786 for ; Wed, 24 Jun 2020 13:14:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="iWdGAHjT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B46E120786 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo5Ea-000803-Tp for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 09:14:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo5BG-0002df-RW for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:10 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:54625 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jo5BE-0001WU-Dh for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593004267; 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=+fe8BYH1YDyqVe9iNEOk6dpYQe4tDIxPQC7jVI46fPM=; b=iWdGAHjTEKc7oHl6fV/xJYSwXOTLZ0P+WhdZE6QwxPXJP2uQCCAGHCb/XsMplu+1FWthIY 0ZPNJVW+xLMQYM6HRcqZVDlFjyIxjGeW9hxpXxC84jw1BiSkKmcryIghn6MhQaeR2P1Z6h A6gveVHmwdTAi8jLKRG3ElScHEDsm74= 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-240-PaDtm5KyO8qVG-qsqDf86A-1; Wed, 24 Jun 2020 09:11:06 -0400 X-MC-Unique: PaDtm5KyO8qVG-qsqDf86A-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 1189A18A8221 for ; Wed, 24 Jun 2020 13:11:04 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0BC260C80; Wed, 24 Jun 2020 13:10:55 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id E9B6031E28; Wed, 24 Jun 2020 15:10:45 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v5 08/10] vga: build virtio-gpu only once Date: Wed, 24 Jun 2020 15:10:43 +0200 Message-Id: <20200624131045.14512-9-kraxel@redhat.com> In-Reply-To: <20200624131045.14512-1-kraxel@redhat.com> References: <20200624131045.14512-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.61; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 00:34:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , dinechin@redhat.com, Paolo Bonzini , philmd@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- hw/display/Makefile.objs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs index 76b3571e4902..d619594ad4d3 100644 --- a/hw/display/Makefile.objs +++ b/hw/display/Makefile.objs @@ -49,12 +49,12 @@ common-obj-m += qxl.mo qxl.mo-objs = qxl.o qxl-logger.o qxl-render.o endif -obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o -obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o -obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o -obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o -obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o -obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o +common-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o +common-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o +common-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o +common-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o +common-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o +common-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o virtio-gpu.o-cflags := $(VIRGL_CFLAGS) virtio-gpu.o-libs += $(VIRGL_LIBS) virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS) From patchwork Wed Jun 24 13:10:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11623141 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E0F31913 for ; Wed, 24 Jun 2020 13:16:15 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B80BA20720 for ; Wed, 24 Jun 2020 13:16:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fivRbQhT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B80BA20720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:41490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo5GB-0002Lj-0F for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 09:16:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo5BC-0002Pk-98 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:06 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:30239 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jo5B9-0001UH-Ho for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593004262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=Xmdr85ijcUm6HTHcrkDo6CDEnYdyTDjjQWSQALnldGQ=; b=fivRbQhTnL4tVTHm8H0V2CdF8Ss4+t71do+k6/wAdV7BEQhaOThRa1oFynJAiQqBaxThYg Pvc6e5ly0fDyfl1WnsxH8v9PtcZDcv623mIR5zdKOBcJXu6uRvo9noAKukdZpHn8P2iKac 92nf9Zvd6p8qFfvdr3e9eAL7NwXpfas= 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-192-z8cMLYuIPi24PvMa-hhtDg-1; Wed, 24 Jun 2020 09:10:57 -0400 X-MC-Unique: z8cMLYuIPi24PvMa-hhtDg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2AEB28015F6 for ; Wed, 24 Jun 2020 13:10:56 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id C83DB5C661; Wed, 24 Jun 2020 13:10:55 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id F3FDE31E2A; Wed, 24 Jun 2020 15:10:45 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v5 09/10] vga: build virtio-gpu as module Date: Wed, 24 Jun 2020 15:10:44 +0200 Message-Id: <20200624131045.14512-10-kraxel@redhat.com> In-Reply-To: <20200624131045.14512-1-kraxel@redhat.com> References: <20200624131045.14512-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.61; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 00:34:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , dinechin@redhat.com, Paolo Bonzini , philmd@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Drops libvirglrenderer.so dependency from core qemu. Signed-off-by: Gerd Hoffmann Reviewed-by: Christophe de Dinechin --- util/module.c | 6 ++++++ hw/display/Makefile.objs | 23 +++++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/util/module.c b/util/module.c index 7c76d2a84b94..a74214eac052 100644 --- a/util/module.c +++ b/util/module.c @@ -266,6 +266,12 @@ static struct { { "usb-redir", "hw-", "usb-redirect" }, { "qxl-vga", "hw-", "display-qxl" }, { "qxl", "hw-", "display-qxl" }, + { "virtio-gpu-device", "hw-", "display-virtio-gpu" }, + { "virtio-gpu-pci", "hw-", "display-virtio-gpu" }, + { "virtio-vga", "hw-", "display-virtio-gpu" }, + { "vhost-user-gpu-device", "hw-", "display-virtio-gpu" }, + { "vhost-user-gpu-pci", "hw-", "display-virtio-gpu" }, + { "vhost-user-vga", "hw-", "display-virtio-gpu" }, }; static bool module_loaded_qom_all; diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs index d619594ad4d3..e907f3182b0c 100644 --- a/hw/display/Makefile.objs +++ b/hw/display/Makefile.objs @@ -49,16 +49,19 @@ common-obj-m += qxl.mo qxl.mo-objs = qxl.o qxl-logger.o qxl-render.o endif -common-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o -common-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o -common-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o -common-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o -common-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o -common-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o -virtio-gpu.o-cflags := $(VIRGL_CFLAGS) -virtio-gpu.o-libs += $(VIRGL_LIBS) -virtio-gpu-3d.o-cflags := $(VIRGL_CFLAGS) -virtio-gpu-3d.o-libs += $(VIRGL_LIBS) +ifeq ($(CONFIG_VIRTIO_GPU),y) +common-obj-m += virtio-gpu.mo +virtio-gpu-obj-$(CONFIG_VIRTIO_GPU) += virtio-gpu-base.o virtio-gpu.o virtio-gpu-3d.o +virtio-gpu-obj-$(CONFIG_VHOST_USER_GPU) += vhost-user-gpu.o +virtio-gpu-obj-$(call land,$(CONFIG_VIRTIO_GPU),$(CONFIG_VIRTIO_PCI)) += virtio-gpu-pci.o +virtio-gpu-obj-$(call land,$(CONFIG_VHOST_USER_GPU),$(CONFIG_VIRTIO_PCI)) += vhost-user-gpu-pci.o +virtio-gpu-obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o +virtio-gpu-obj-$(CONFIG_VHOST_USER_VGA) += vhost-user-vga.o +virtio-gpu.mo-objs := $(virtio-gpu-obj-y) +virtio-gpu.mo-cflags := $(VIRGL_CFLAGS) +virtio-gpu.mo-libs := $(VIRGL_LIBS) +endif + common-obj-$(CONFIG_DPCD) += dpcd.o common-obj-$(CONFIG_XLNX_ZYNQMP_ARM) += xlnx_dp.o From patchwork Wed Jun 24 13:10:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11623147 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 32D1F913 for ; Wed, 24 Jun 2020 13:17:52 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DD62720720 for ; Wed, 24 Jun 2020 13:17:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Lwm8oSwT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD62720720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:47232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo5Hi-0004ul-RD for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 09:17:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo5BG-0002e0-VT for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:10 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:55025 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jo5BE-0001WY-PS for qemu-devel@nongnu.org; Wed, 24 Jun 2020 09:11:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593004268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=jNvjDihMqIwe37qxbHQlIK02xyr/p93khFFBpDtVnfE=; b=Lwm8oSwTvq/plf4B7bgFodfdUpMsMpkl+oigaxccRyIFKIhojLqoKB9bK0fEQyYE6vFzN3 pTXRHF0KjjRx2IdDFswHuPV+NTt06ftuAAv2CD04hjbmZ8m+wZQ5WRAum0CJ8VkSWjLllA up3HSR7RTH/jO1jPg7yv2Ho0fdXvnik= 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-285-c0xaF3xHME6cixWqPxpGDA-1; Wed, 24 Jun 2020 09:11:06 -0400 X-MC-Unique: c0xaF3xHME6cixWqPxpGDA-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 206EC18A8223 for ; Wed, 24 Jun 2020 13:11:04 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC46760F8A; Wed, 24 Jun 2020 13:10:55 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0D48531E32; Wed, 24 Jun 2020 15:10:46 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v5 10/10] chardev: enable modules, use for braille Date: Wed, 24 Jun 2020 15:10:45 +0200 Message-Id: <20200624131045.14512-11-kraxel@redhat.com> In-Reply-To: <20200624131045.14512-1-kraxel@redhat.com> References: <20200624131045.14512-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 01:59:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , dinechin@redhat.com, Paolo Bonzini , philmd@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Removes brlapi library dependency from core qemu. Signed-off-by: Gerd Hoffmann --- Makefile.objs | 1 + chardev/char.c | 2 +- util/module.c | 1 + chardev/Makefile.objs | 5 ++++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index ca555ede0710..2dfcd19713f8 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -71,6 +71,7 @@ common-obj-$(CONFIG_TPM) += tpm.o common-obj-y += backends/ common-obj-y += chardev/ +common-obj-m += chardev/ common-obj-$(CONFIG_SECCOMP) += qemu-seccomp.o qemu-seccomp.o-cflags := $(SECCOMP_CFLAGS) diff --git a/chardev/char.c b/chardev/char.c index e3051295ac37..df697f3ce9e0 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -527,7 +527,7 @@ static const ChardevClass *char_get_class(const char *driver, Error **errp) const ChardevClass *cc; char *typename = g_strdup_printf("chardev-%s", driver); - oc = object_class_by_name(typename); + oc = module_object_class_by_name(typename); g_free(typename); if (!object_class_dynamic_cast(oc, TYPE_CHARDEV)) { diff --git a/util/module.c b/util/module.c index a74214eac052..32b0547b8266 100644 --- a/util/module.c +++ b/util/module.c @@ -272,6 +272,7 @@ static struct { { "vhost-user-gpu-device", "hw-", "display-virtio-gpu" }, { "vhost-user-gpu-pci", "hw-", "display-virtio-gpu" }, { "vhost-user-vga", "hw-", "display-virtio-gpu" }, + { "chardev-braille", "chardev-", "baum" }, }; static bool module_loaded_qom_all; diff --git a/chardev/Makefile.objs b/chardev/Makefile.objs index d68e1347f9af..3a58c9d329d6 100644 --- a/chardev/Makefile.objs +++ b/chardev/Makefile.objs @@ -18,8 +18,11 @@ chardev-obj-$(CONFIG_WIN32) += char-win.o chardev-obj-$(CONFIG_WIN32) += char-win-stdio.o common-obj-y += msmouse.o wctablet.o testdev.o -common-obj-$(CONFIG_BRLAPI) += baum.o + +ifeq ($(CONFIG_BRLAPI),y) +common-obj-m += baum.o baum.o-cflags := $(SDL_CFLAGS) baum.o-libs := $(BRLAPI_LIBS) +endif common-obj-$(CONFIG_SPICE) += spice.o