From patchwork Thu Oct 22 05:12:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850259 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 21C2414B7 for ; Thu, 22 Oct 2020 05:15:04 +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 B74172145D for ; Thu, 22 Oct 2020 05: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="H+d7l21A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B74172145D 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]:41558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVSwI-0007WF-HC for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:15:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVSu0-0003ej-CH for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:46623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVStv-0003wD-74 for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343554; 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=l//AX153FspWPkvWboiscr8w6tNgQgDXAHu+0xePpzQ=; b=H+d7l21AFbsS/wjisGeOhS3RZpmO7Jn+6vxFMOYOmfOn2+3/uwjkvmNu+o9mRF/qRHIQaf k2PDDOCRWX28cGCaEl5g5Hop5e4Mc6XgxooHlzRWnDZ+dSJbEDtSY7ok2TwzBjwm1AHRp9 w2WrWys5a9W3YeWavP3qfWIwzHE6Hzo= 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-88-pmrJobdtMnisJ2JTORR4ag-1; Thu, 22 Oct 2020 01:12:31 -0400 X-MC-Unique: pmrJobdtMnisJ2JTORR4ag-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 E69C0803F61 for ; Thu, 22 Oct 2020 05:12:30 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 57D626EF42; Thu, 22 Oct 2020 05:12:24 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6FC289D74; Thu, 22 Oct 2020 07:12:23 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 01/14] spice: add module helpers Date: Thu, 22 Oct 2020 07:12:10 +0200 Message-Id: <20201022051223.6181-2-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 23:30:42 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H5=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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add new spice-module.c + qemu-spice-module.h files. The code needed to support modular spice will be there. For starters this will be only the using_spice variable, more will follow ... Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-2-kraxel@redhat.com --- include/ui/qemu-spice-module.h | 23 +++++++++++++++++++++++ include/ui/qemu-spice.h | 4 +--- ui/spice-core.c | 1 - ui/spice-module.c | 23 +++++++++++++++++++++++ ui/meson.build | 1 + 5 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 include/ui/qemu-spice-module.h create mode 100644 ui/spice-module.c diff --git a/include/ui/qemu-spice-module.h b/include/ui/qemu-spice-module.h new file mode 100644 index 000000000000..1af0e659a109 --- /dev/null +++ b/include/ui/qemu-spice-module.h @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2010 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 or + * (at your option) version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef QEMU_SPICE_MODULE_H +#define QEMU_SPICE_MODULE_H + +extern int using_spice; + +#endif diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index 0e8ec3f0d776..ab523788b9a9 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -19,14 +19,13 @@ #define QEMU_SPICE_H #include "qapi/error.h" +#include "ui/qemu-spice-module.h" #ifdef CONFIG_SPICE #include #include "qemu/config-file.h" -extern int using_spice; - void qemu_spice_init(void); void qemu_spice_input_init(void); void qemu_spice_display_init(void); @@ -50,7 +49,6 @@ int qemu_spice_migrate_info(const char *hostname, int port, int tls_port, #include "qemu/error-report.h" -#define using_spice 0 #define spice_displays 0 static inline int qemu_spice_set_passwd(const char *passwd, bool fail_if_connected, diff --git a/ui/spice-core.c b/ui/spice-core.c index 47700b220059..a7fa5743585f 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -48,7 +48,6 @@ static time_t auth_expires = TIME_MAX; static int spice_migration_completed; static int spice_display_is_running; static int spice_have_target_host; -int using_spice = 0; static QemuThread me; diff --git a/ui/spice-module.c b/ui/spice-module.c new file mode 100644 index 000000000000..f86b0ac517dc --- /dev/null +++ b/ui/spice-module.c @@ -0,0 +1,23 @@ +/* + * spice module support, also spice stubs. + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 or + * (at your option) version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include "qemu/osdep.h" +#include "ui/qemu-spice-module.h" + +int using_spice; diff --git a/ui/meson.build b/ui/meson.build index ab4de98b381b..e89e298643a3 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -12,6 +12,7 @@ softmmu_ss.add(files( 'keymaps.c', 'qemu-pixman.c', )) +softmmu_ss.add([spice_headers, files('spice-module.c')]) softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('input-linux.c')) softmmu_ss.add(when: [spice, 'CONFIG_SPICE'], if_true: files('spice-core.c', 'spice-input.c', 'spice-display.c')) From patchwork Thu Oct 22 05:12:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850255 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 6DB7F92C for ; Thu, 22 Oct 2020 05:13:34 +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 1AC982145D for ; Thu, 22 Oct 2020 05:13:34 +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="bUvaKSqC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AC982145D 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]:36100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVSur-0005KP-2M for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:13:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVStx-0003dQ-Po for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25710) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVStu-0003vw-CZ for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343553; 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=b/dqN6zoU6R/3M/XJ+oBnTnmMnYempTT8Ndoj0VMJSo=; b=bUvaKSqClexq3GqAyAExtY2eqLQ6zPef+yZwzvdT8O8VKRdwf9wFqZ85PnysWsCws3uJ2Q aTmnXJENeQ4LlBtlq37Ou6dNZrPrPkCt4nw1Y0hKbEZ3MTh82FDM3AwzhkPL+naLV+SwVU PG3WfUjlbRzi6+sTWmpDurtzpC+OUEY= 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-248-WI1_ygz3O6ugq_Ge7Vg64A-1; Thu, 22 Oct 2020 01:12:31 -0400 X-MC-Unique: WI1_ygz3O6ugq_Ge7Vg64A-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 76B81835B49 for ; Thu, 22 Oct 2020 05:12:30 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 57B5C5D9DD; Thu, 22 Oct 2020 05:12:24 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7F61D9D0D; Thu, 22 Oct 2020 07:12:23 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 02/14] spice: add QemuSpiceOps, move migrate_info Date: Thu, 22 Oct 2020 07:12:11 +0200 Message-Id: <20201022051223.6181-3-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 23:30:42 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H5=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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Add QemuSpiceOps struct. This struct holds function pointers to the spice functions. It will be initialized with pointers to the stub functions. When spice gets initialized the function pointers will be re-written to the real functions. The spice stubs will move from qemu-spice.h to spice-module.c for that, because they will be needed for both "CONFIG_SPICE=n" and "CONFIG_SPICE=y but spice module not loaded" cases. This patch adds the infrastructure and starts with moving qemu_spice_migrate_info() to QemuSpiceOps. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-3-kraxel@redhat.com --- include/ui/qemu-spice-module.h | 5 +++++ include/ui/qemu-spice.h | 5 ----- monitor/misc.c | 2 +- ui/spice-core.c | 5 +++++ ui/spice-module.c | 10 ++++++++++ 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/include/ui/qemu-spice-module.h b/include/ui/qemu-spice-module.h index 1af0e659a109..7a9963dd5810 100644 --- a/include/ui/qemu-spice-module.h +++ b/include/ui/qemu-spice-module.h @@ -18,6 +18,11 @@ #ifndef QEMU_SPICE_MODULE_H #define QEMU_SPICE_MODULE_H +struct QemuSpiceOps { + int (*migrate_info)(const char *h, int p, int t, const char *s); +}; + extern int using_spice; +extern struct QemuSpiceOps qemu_spice; #endif diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index ab523788b9a9..3157016c2bb4 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -60,11 +60,6 @@ static inline int qemu_spice_set_pw_expire(time_t expires) { return -1; } -static inline int qemu_spice_migrate_info(const char *h, int p, int t, - const char *s) -{ - return -1; -} static inline int qemu_spice_display_add_client(int csock, int skipauth, int tls) diff --git a/monitor/misc.c b/monitor/misc.c index 4a859fb24a21..32e6a8c13d07 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -437,7 +437,7 @@ void qmp_client_migrate_info(const char *protocol, const char *hostname, return; } - if (qemu_spice_migrate_info(hostname, + if (qemu_spice.migrate_info(hostname, has_port ? port : -1, has_tls_port ? tls_port : -1, cert_subject)) { diff --git a/ui/spice-core.c b/ui/spice-core.c index a7fa5743585f..b03d743cf9b9 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -993,8 +993,13 @@ int qemu_spice_display_is_running(SimpleSpiceDisplay *ssd) return spice_display_is_running; } +static struct QemuSpiceOps real_spice_ops = { + .migrate_info = qemu_spice_migrate_info, +}; + static void spice_register_config(void) { + qemu_spice = real_spice_ops; qemu_add_opts(&qemu_spice_opts); } opts_init(spice_register_config); diff --git a/ui/spice-module.c b/ui/spice-module.c index f86b0ac517dc..f1939545a684 100644 --- a/ui/spice-module.c +++ b/ui/spice-module.c @@ -21,3 +21,13 @@ #include "ui/qemu-spice-module.h" int using_spice; + +static int qemu_spice_migrate_info_stub(const char *h, int p, int t, + const char *s) +{ + return -1; +} + +struct QemuSpiceOps qemu_spice = { + .migrate_info = qemu_spice_migrate_info_stub, +}; From patchwork Thu Oct 22 05:12:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850287 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 1AB5414B7 for ; Thu, 22 Oct 2020 05:18:04 +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 BD61C2145D for ; Thu, 22 Oct 2020 05:18: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="bvQ4CUob" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD61C2145D 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]:52764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVSzC-0003lG-MW for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:18:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVSu0-0003er-FR for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVStu-0003vx-DE for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343553; 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=sSEzA0lt6WFnE/KBczxLWYIGVO/nSAAX0EbUW7irl+M=; b=bvQ4CUobowDfhAc1D6SZvQPmUGLCcZVTUrdZ1ZYcFC0GSrPYBkxJVimbL8aZ86aRyBtCaS mkDH4MG1rvzTDvgXt21AZ4Mtg9jZqS3iQQu81i8mvl9VexXnW80lhSJzctyI1hwi5JQVwQ MXhAxkmjCvss3lYaprwy+kV5OjZM9YE= 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-248-fHnzmxquOzmfID1H_zGs3g-1; Thu, 22 Oct 2020 01:12:31 -0400 X-MC-Unique: fHnzmxquOzmfID1H_zGs3g-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 9F908186DD24 for ; Thu, 22 Oct 2020 05:12:30 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 57BCB60C47; Thu, 22 Oct 2020 05:12:24 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8EB129D0E; Thu, 22 Oct 2020 07:12:23 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 03/14] spice: move qemu_spice_init() to QemuSpiceOps. Date: Thu, 22 Oct 2020 07:12:12 +0200 Message-Id: <20201022051223.6181-4-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 23:30:42 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H5=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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-4-kraxel@redhat.com --- include/ui/qemu-spice-module.h | 1 + include/ui/qemu-spice.h | 5 ----- softmmu/vl.c | 2 +- ui/spice-core.c | 3 ++- ui/spice-module.c | 5 +++++ 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/ui/qemu-spice-module.h b/include/ui/qemu-spice-module.h index 7a9963dd5810..b182bc4c21a6 100644 --- a/include/ui/qemu-spice-module.h +++ b/include/ui/qemu-spice-module.h @@ -19,6 +19,7 @@ #define QEMU_SPICE_MODULE_H struct QemuSpiceOps { + void (*init)(void); int (*migrate_info)(const char *h, int p, int t, const char *s); }; diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index 3157016c2bb4..e6df0a8715b0 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -26,7 +26,6 @@ #include #include "qemu/config-file.h" -void qemu_spice_init(void); void qemu_spice_input_init(void); void qemu_spice_display_init(void); int qemu_spice_display_add_client(int csock, int skipauth, int tls); @@ -74,10 +73,6 @@ static inline void qemu_spice_display_init(void) abort(); } -static inline void qemu_spice_init(void) -{ -} - #endif /* CONFIG_SPICE */ static inline bool qemu_using_spice(Error **errp) diff --git a/softmmu/vl.c b/softmmu/vl.c index cb476aa70bcc..65c34a6b8a2e 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -4151,7 +4151,7 @@ void qemu_init(int argc, char **argv, char **envp) /* spice needs the timers to be initialized by this point */ /* spice must initialize before audio as it changes the default auiodev */ /* spice must initialize before chardevs (for spicevmc and spiceport) */ - qemu_spice_init(); + qemu_spice.init(); qemu_opts_foreach(qemu_find_opts("chardev"), chardev_init_func, NULL, &error_fatal); diff --git a/ui/spice-core.c b/ui/spice-core.c index b03d743cf9b9..6ef66eb387de 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -633,7 +633,7 @@ static void vm_change_state_handler(void *opaque, int running, } } -void qemu_spice_init(void) +static void qemu_spice_init(void) { QemuOpts *opts = QTAILQ_FIRST(&qemu_spice_opts.head); const char *password, *str, *x509_dir, *addr, @@ -994,6 +994,7 @@ int qemu_spice_display_is_running(SimpleSpiceDisplay *ssd) } static struct QemuSpiceOps real_spice_ops = { + .init = qemu_spice_init, .migrate_info = qemu_spice_migrate_info, }; diff --git a/ui/spice-module.c b/ui/spice-module.c index f1939545a684..a30fa452ea93 100644 --- a/ui/spice-module.c +++ b/ui/spice-module.c @@ -22,6 +22,10 @@ int using_spice; +static void qemu_spice_init_stub(void) +{ +} + static int qemu_spice_migrate_info_stub(const char *h, int p, int t, const char *s) { @@ -29,5 +33,6 @@ static int qemu_spice_migrate_info_stub(const char *h, int p, int t, } struct QemuSpiceOps qemu_spice = { + .init = qemu_spice_init_stub, .migrate_info = qemu_spice_migrate_info_stub, }; From patchwork Thu Oct 22 05:12:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850253 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 4EC1392C for ; Thu, 22 Oct 2020 05:13:33 +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 01EA92145D for ; Thu, 22 Oct 2020 05:13:32 +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="jBkNhzZg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01EA92145D 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]:35990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVSup-0005Hi-RA for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:13:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVStx-0003cv-44 for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVStu-0003w1-9R for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343553; 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=Pj9BYsv+yyyPlWel/6ah+YJvXkaqMS6iE4H6MMGKnsE=; b=jBkNhzZg4tZGpcdNaTtwAPU5YixAUPyL91HwUsaifeF+d32JprZTnztxm1jpFx0+bJ57Yr XgV553lDBg48UKPtXgZ8aclstAsl6ApXiDFSrGXXOjtX4W9Ktf/Mj4FqOBwXQQ/XDs/PS/ qYdM/9k7Hjo+n/swOxOog8eMwWp2jE8= 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-251-LcQ1_x6EPnme1WOUPixDZA-1; Thu, 22 Oct 2020 01:12:31 -0400 X-MC-Unique: LcQ1_x6EPnme1WOUPixDZA-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 9F85B835B4F for ; Thu, 22 Oct 2020 05:12:30 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D33E1002C04; Thu, 22 Oct 2020 05:12:24 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9DFFD9D0F; Thu, 22 Oct 2020 07:12:23 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 04/14] spice: move display_init() to QemuSpiceOps. Date: Thu, 22 Oct 2020 07:12:13 +0200 Message-Id: <20201022051223.6181-5-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-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-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/22 00:54:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-5-kraxel@redhat.com --- include/ui/qemu-spice-module.h | 1 + include/ui/qemu-spice.h | 7 ------- softmmu/vl.c | 2 +- ui/spice-core.c | 1 + ui/spice-module.c | 9 +++++++++ 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/ui/qemu-spice-module.h b/include/ui/qemu-spice-module.h index b182bc4c21a6..dbe09035dade 100644 --- a/include/ui/qemu-spice-module.h +++ b/include/ui/qemu-spice-module.h @@ -20,6 +20,7 @@ struct QemuSpiceOps { void (*init)(void); + void (*display_init)(void); int (*migrate_info)(const char *h, int p, int t, const char *s); }; diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index e6df0a8715b0..a3fd1ea5ade8 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -66,13 +66,6 @@ static inline int qemu_spice_display_add_client(int csock, int skipauth, return -1; } -static inline void qemu_spice_display_init(void) -{ - /* This must never be called if CONFIG_SPICE is disabled */ - error_report("spice support is disabled"); - abort(); -} - #endif /* CONFIG_SPICE */ static inline bool qemu_using_spice(Error **errp) diff --git a/softmmu/vl.c b/softmmu/vl.c index 65c34a6b8a2e..8a06fe8bf77a 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -4447,7 +4447,7 @@ void qemu_init(int argc, char **argv, char **envp) #endif if (using_spice) { - qemu_spice_display_init(); + qemu_spice.display_init(); } if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) { diff --git a/ui/spice-core.c b/ui/spice-core.c index 6ef66eb387de..82d5dbda3e26 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -995,6 +995,7 @@ int qemu_spice_display_is_running(SimpleSpiceDisplay *ssd) static struct QemuSpiceOps real_spice_ops = { .init = qemu_spice_init, + .display_init = qemu_spice_display_init, .migrate_info = qemu_spice_migrate_info, }; diff --git a/ui/spice-module.c b/ui/spice-module.c index a30fa452ea93..56868aaffe9a 100644 --- a/ui/spice-module.c +++ b/ui/spice-module.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "ui/qemu-spice-module.h" int using_spice; @@ -26,6 +27,13 @@ static void qemu_spice_init_stub(void) { } +static void qemu_spice_display_init_stub(void) +{ + /* This must never be called if CONFIG_SPICE is disabled */ + error_report("spice support is disabled"); + abort(); +} + static int qemu_spice_migrate_info_stub(const char *h, int p, int t, const char *s) { @@ -34,5 +42,6 @@ static int qemu_spice_migrate_info_stub(const char *h, int p, int t, struct QemuSpiceOps qemu_spice = { .init = qemu_spice_init_stub, + .display_init = qemu_spice_display_init_stub, .migrate_info = qemu_spice_migrate_info_stub, }; From patchwork Thu Oct 22 05:12:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850295 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 7C34914B7 for ; Thu, 22 Oct 2020 05:20:23 +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 199AA2244C for ; Thu, 22 Oct 2020 05:20:23 +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="ZiYWEZV/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 199AA2244C 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]:59430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVT1S-0006Xf-0z for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:20:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVSuB-0003qJ-Gp for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVSu6-0003z9-EY for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343563; 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=Qha+9NtEWPSLnz/grVGF9D4kfTA/XaaDFcqMGN+6PSY=; b=ZiYWEZV/4Ra2w0rCAvJTlt88ILz7A1PT+AzuCR8Av+Jr/PAD/R1WJAtaIYrIDHWMGknroO FmNk1lpZ4PiHWStUj2h9ohPrM29AO0nE5oU6N6K1k4xN21WzbsBPkOCR/a/kZMmfdYjqQu fLKpE//tBNuNs1Rbwq5xNNaxUAsLhpQ= 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-494-5qDq9kgGPqyV2Nrfeh2ZPw-1; Thu, 22 Oct 2020 01:12:41 -0400 X-MC-Unique: 5qDq9kgGPqyV2Nrfeh2ZPw-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 83983835B5D for ; Thu, 22 Oct 2020 05:12:40 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5085A5C1C7; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AF3129D10; Thu, 22 Oct 2020 07:12:23 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 05/14] spice: move add_interface() to QemuSpiceOps. Date: Thu, 22 Oct 2020 07:12:14 +0200 Message-Id: <20201022051223.6181-6-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 23:30:42 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H5=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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-6-kraxel@redhat.com --- include/ui/qemu-spice-module.h | 7 +++++++ include/ui/qemu-spice.h | 1 - audio/spiceaudio.c | 4 ++-- chardev/spice.c | 2 +- ui/spice-core.c | 5 +++-- ui/spice-input.c | 6 +++--- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/include/ui/qemu-spice-module.h b/include/ui/qemu-spice-module.h index dbe09035dade..f93acde5743c 100644 --- a/include/ui/qemu-spice-module.h +++ b/include/ui/qemu-spice-module.h @@ -18,10 +18,17 @@ #ifndef QEMU_SPICE_MODULE_H #define QEMU_SPICE_MODULE_H +#ifdef CONFIG_SPICE +#include +#endif + struct QemuSpiceOps { void (*init)(void); void (*display_init)(void); int (*migrate_info)(const char *h, int p, int t, const char *s); +#ifdef CONFIG_SPICE + int (*add_interface)(SpiceBaseInstance *sin); +#endif }; extern int using_spice; diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index a3fd1ea5ade8..6018577c5278 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -29,7 +29,6 @@ void qemu_spice_input_init(void); void qemu_spice_display_init(void); int qemu_spice_display_add_client(int csock, int skipauth, int tls); -int qemu_spice_add_interface(SpiceBaseInstance *sin); bool qemu_spice_have_display_interface(QemuConsole *con); int qemu_spice_add_display_interface(QXLInstance *qxlin, QemuConsole *con); int qemu_spice_set_passwd(const char *passwd, diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index ed6dff1dcc41..8967cca12925 100644 --- a/audio/spiceaudio.c +++ b/audio/spiceaudio.c @@ -106,7 +106,7 @@ static int line_out_init(HWVoiceOut *hw, struct audsettings *as, out->active = 0; out->sin.base.sif = &playback_sif.base; - qemu_spice_add_interface (&out->sin.base); + qemu_spice.add_interface(&out->sin.base); #if SPICE_INTERFACE_PLAYBACK_MAJOR > 1 || SPICE_INTERFACE_PLAYBACK_MINOR >= 3 spice_server_set_playback_rate(&out->sin, settings.freq); #endif @@ -215,7 +215,7 @@ static int line_in_init(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque) in->active = 0; in->sin.base.sif = &record_sif.base; - qemu_spice_add_interface (&in->sin.base); + qemu_spice.add_interface(&in->sin.base); #if SPICE_INTERFACE_RECORD_MAJOR > 2 || SPICE_INTERFACE_RECORD_MINOR >= 3 spice_server_set_record_rate(&in->sin, settings.freq); #endif diff --git a/chardev/spice.c b/chardev/spice.c index 7d1fb1771894..1104426e3a11 100644 --- a/chardev/spice.c +++ b/chardev/spice.c @@ -110,7 +110,7 @@ static void vmc_register_interface(SpiceChardev *scd) return; } scd->sin.base.sif = &vmc_interface.base; - qemu_spice_add_interface(&scd->sin.base); + qemu_spice.add_interface(&scd->sin.base); scd->active = true; trace_spice_vmc_register_interface(scd); } diff --git a/ui/spice-core.c b/ui/spice-core.c index 82d5dbda3e26..483d880a3362 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -800,7 +800,7 @@ static void qemu_spice_init(void) migration_state.notify = migration_state_notifier; add_migration_state_change_notifier(&migration_state); spice_migrate.base.sif = &migrate_interface.base; - qemu_spice_add_interface(&spice_migrate.base); + qemu_spice.add_interface(&spice_migrate.base); qemu_spice_input_init(); @@ -829,7 +829,7 @@ static void qemu_spice_init(void) #endif } -int qemu_spice_add_interface(SpiceBaseInstance *sin) +static int qemu_spice_add_interface(SpiceBaseInstance *sin) { if (!spice_server) { if (QTAILQ_FIRST(&qemu_spice_opts.head) != NULL) { @@ -997,6 +997,7 @@ static struct QemuSpiceOps real_spice_ops = { .init = qemu_spice_init, .display_init = qemu_spice_display_init, .migrate_info = qemu_spice_migrate_info, + .add_interface = qemu_spice_add_interface, }; static void spice_register_config(void) diff --git a/ui/spice-input.c b/ui/spice-input.c index 21990fa9962b..bbd502564edf 100644 --- a/ui/spice-input.c +++ b/ui/spice-input.c @@ -231,7 +231,7 @@ static void mouse_mode_notifier(Notifier *notifier, void *data) } if (is_absolute) { - qemu_spice_add_interface(&pointer->tablet.base); + qemu_spice.add_interface(&pointer->tablet.base); } else { spice_server_remove_interface(&pointer->tablet.base); } @@ -245,13 +245,13 @@ void qemu_spice_input_init(void) kbd = g_malloc0(sizeof(*kbd)); kbd->sin.base.sif = &kbd_interface.base; - qemu_spice_add_interface(&kbd->sin.base); + qemu_spice.add_interface(&kbd->sin.base); qemu_add_led_event_handler(kbd_leds, kbd); pointer = g_malloc0(sizeof(*pointer)); pointer->mouse.base.sif = &mouse_interface.base; pointer->tablet.base.sif = &tablet_interface.base; - qemu_spice_add_interface(&pointer->mouse.base); + qemu_spice.add_interface(&pointer->mouse.base); pointer->absolute = false; pointer->mouse_mode.notify = mouse_mode_notifier; From patchwork Thu Oct 22 05:12:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850291 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 D2C0F14B7 for ; Thu, 22 Oct 2020 05:18:08 +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 6AB742145D for ; Thu, 22 Oct 2020 05:18:08 +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="azVlSVt6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AB742145D 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]:53224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVSzH-0003wZ-Cf for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:18:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVSuD-0003sA-PX for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21652) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVSu6-0003z6-Cy for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343563; 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=ujqFnpe2lE/+KB5mvSfPgLbiFsYoy8v/3VePd0G5WSE=; b=azVlSVt6ZVifWNHLayDtB35fngrFtBzLEVARXMxwRUhl7H2xstH2om2aCwUUSQPXHAjoCs /lPTAxbxHchKvV+C6zy581n51BUgscwHUztA9av8PK5PjIIUdvz08EWtKFqhZxaRpPF4mL lshTjgDnAgXsDVybgv0UwZBGFx0ju+Q= 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-215-aNdVDe9MMkmijQY91CX_lw-1; Thu, 22 Oct 2020 01:12:41 -0400 X-MC-Unique: aNdVDe9MMkmijQY91CX_lw-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 6FEE11084D69 for ; Thu, 22 Oct 2020 05:12:40 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 501205B4B2; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BE91C43BFA1; Thu, 22 Oct 2020 07:12:23 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 06/14] spice: move auth functions to QemuSpiceOps. Date: Thu, 22 Oct 2020 07:12:15 +0200 Message-Id: <20201022051223.6181-7-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-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-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/22 00:54:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Move qemu_spice_set_passwd() and qemu_spice_set_pw_expire() functions to QemuSpiceOps. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-7-kraxel@redhat.com --- include/ui/qemu-spice-module.h | 3 +++ include/ui/qemu-spice.h | 14 -------------- monitor/qmp-cmds.c | 4 ++-- ui/spice-core.c | 10 ++++++---- ui/spice-module.c | 14 ++++++++++++++ 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/include/ui/qemu-spice-module.h b/include/ui/qemu-spice-module.h index f93acde5743c..1ea3a999ce8a 100644 --- a/include/ui/qemu-spice-module.h +++ b/include/ui/qemu-spice-module.h @@ -26,6 +26,9 @@ struct QemuSpiceOps { void (*init)(void); void (*display_init)(void); int (*migrate_info)(const char *h, int p, int t, const char *s); + int (*set_passwd)(const char *passwd, + bool fail_if_connected, bool disconnect_if_connected); + int (*set_pw_expire)(time_t expires); #ifdef CONFIG_SPICE int (*add_interface)(SpiceBaseInstance *sin); #endif diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index 6018577c5278..921b7a38d023 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -31,9 +31,6 @@ void qemu_spice_display_init(void); int qemu_spice_display_add_client(int csock, int skipauth, int tls); bool qemu_spice_have_display_interface(QemuConsole *con); int qemu_spice_add_display_interface(QXLInstance *qxlin, QemuConsole *con); -int qemu_spice_set_passwd(const char *passwd, - bool fail_if_connected, bool disconnect_if_connected); -int qemu_spice_set_pw_expire(time_t expires); int qemu_spice_migrate_info(const char *hostname, int port, int tls_port, const char *subject); @@ -48,17 +45,6 @@ int qemu_spice_migrate_info(const char *hostname, int port, int tls_port, #include "qemu/error-report.h" #define spice_displays 0 -static inline int qemu_spice_set_passwd(const char *passwd, - bool fail_if_connected, - bool disconnect_if_connected) -{ - return -1; -} -static inline int qemu_spice_set_pw_expire(time_t expires) -{ - return -1; -} - static inline int qemu_spice_display_add_client(int csock, int skipauth, int tls) { diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index 1abef70a8959..8ac59977e661 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -197,7 +197,7 @@ void qmp_set_password(const char *protocol, const char *password, if (!qemu_using_spice(errp)) { return; } - rc = qemu_spice_set_passwd(password, fail_if_connected, + rc = qemu_spice.set_passwd(password, fail_if_connected, disconnect_if_connected); if (rc != 0) { error_setg(errp, QERR_SET_PASSWD_FAILED); @@ -243,7 +243,7 @@ void qmp_expire_password(const char *protocol, const char *whenstr, if (!qemu_using_spice(errp)) { return; } - rc = qemu_spice_set_pw_expire(when); + rc = qemu_spice.set_pw_expire(when); if (rc != 0) { error_setg(errp, QERR_SET_PASSWD_FAILED); } diff --git a/ui/spice-core.c b/ui/spice-core.c index 483d880a3362..4fe543aba058 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -727,7 +727,7 @@ static void qemu_spice_init(void) tls_ciphers); } if (password) { - qemu_spice_set_passwd(password, false, false); + qemu_spice.set_passwd(password, false, false); } if (qemu_opt_get_bool(opts, "sasl", 0)) { if (spice_server_set_sasl(spice_server, 1) == -1) { @@ -941,8 +941,8 @@ static int qemu_spice_set_ticket(bool fail_if_conn, bool disconnect_if_conn) fail_if_conn, disconnect_if_conn); } -int qemu_spice_set_passwd(const char *passwd, - bool fail_if_conn, bool disconnect_if_conn) +static int qemu_spice_set_passwd(const char *passwd, + bool fail_if_conn, bool disconnect_if_conn) { if (strcmp(auth, "spice") != 0) { return -1; @@ -953,7 +953,7 @@ int qemu_spice_set_passwd(const char *passwd, return qemu_spice_set_ticket(fail_if_conn, disconnect_if_conn); } -int qemu_spice_set_pw_expire(time_t expires) +static int qemu_spice_set_pw_expire(time_t expires) { auth_expires = expires; return qemu_spice_set_ticket(false, false); @@ -997,6 +997,8 @@ static struct QemuSpiceOps real_spice_ops = { .init = qemu_spice_init, .display_init = qemu_spice_display_init, .migrate_info = qemu_spice_migrate_info, + .set_passwd = qemu_spice_set_passwd, + .set_pw_expire = qemu_spice_set_pw_expire, .add_interface = qemu_spice_add_interface, }; diff --git a/ui/spice-module.c b/ui/spice-module.c index 56868aaffe9a..299aeb479be5 100644 --- a/ui/spice-module.c +++ b/ui/spice-module.c @@ -40,8 +40,22 @@ static int qemu_spice_migrate_info_stub(const char *h, int p, int t, return -1; } +static int qemu_spice_set_passwd_stub(const char *passwd, + bool fail_if_connected, + bool disconnect_if_connected) +{ + return -1; +} + +static int qemu_spice_set_pw_expire_stub(time_t expires) +{ + return -1; +} + struct QemuSpiceOps qemu_spice = { .init = qemu_spice_init_stub, .display_init = qemu_spice_display_init_stub, .migrate_info = qemu_spice_migrate_info_stub, + .set_passwd = qemu_spice_set_passwd_stub, + .set_pw_expire = qemu_spice_set_pw_expire_stub, }; From patchwork Thu Oct 22 05:12:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850299 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 F152814B2 for ; Thu, 22 Oct 2020 05:23:21 +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 7BDA52245D for ; Thu, 22 Oct 2020 05:23:21 +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="ceRBqAmd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BDA52245D 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]:38090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVT4K-00014E-H7 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:23:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVSuA-0003ot-JO for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVSu6-0003z5-Dk for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343563; 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=n9L3X1tq6cvpCG18lwfprM2YEvEWgjOvtpIfTHmh4U8=; b=ceRBqAmd9ci5B6H2FY30UbZwDr96HEqo5ynFmsc7FF9Ckk5duXPngdjKH1S7zQGCY21gAp WX0CEu8rprwUxhPw0x0eFivVoaSaCW8JnETDtEKgMixJ02SquIWksVvSEDjX2+hjHwyYbR MC3qZqFM7KFpb87lhiY+alV0Hoy2ZYs= 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-305-Wf6Uulz4OFy5ArgdwmNmyQ-1; Thu, 22 Oct 2020 01:12:41 -0400 X-MC-Unique: Wf6Uulz4OFy5ArgdwmNmyQ-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 7C48C835B52 for ; Thu, 22 Oct 2020 05:12:40 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 515FA5C225; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CDEF443BFB9; Thu, 22 Oct 2020 07:12:23 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 07/14] spice: move display_add_client() to QemuSpiceOps. Date: Thu, 22 Oct 2020 07:12:16 +0200 Message-Id: <20201022051223.6181-8-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/22 00:54:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-8-kraxel@redhat.com --- include/ui/qemu-spice-module.h | 1 + include/ui/qemu-spice.h | 6 ------ monitor/qmp-cmds.c | 2 +- ui/spice-core.c | 3 ++- ui/spice-module.c | 7 +++++++ 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/ui/qemu-spice-module.h b/include/ui/qemu-spice-module.h index 1ea3a999ce8a..7422f6404ba0 100644 --- a/include/ui/qemu-spice-module.h +++ b/include/ui/qemu-spice-module.h @@ -29,6 +29,7 @@ struct QemuSpiceOps { int (*set_passwd)(const char *passwd, bool fail_if_connected, bool disconnect_if_connected); int (*set_pw_expire)(time_t expires); + int (*display_add_client)(int csock, int skipauth, int tls); #ifdef CONFIG_SPICE int (*add_interface)(SpiceBaseInstance *sin); #endif diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index 921b7a38d023..2beb7929728c 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -28,7 +28,6 @@ void qemu_spice_input_init(void); void qemu_spice_display_init(void); -int qemu_spice_display_add_client(int csock, int skipauth, int tls); bool qemu_spice_have_display_interface(QemuConsole *con); int qemu_spice_add_display_interface(QXLInstance *qxlin, QemuConsole *con); int qemu_spice_migrate_info(const char *hostname, int port, int tls_port, @@ -45,11 +44,6 @@ int qemu_spice_migrate_info(const char *hostname, int port, int tls_port, #include "qemu/error-report.h" #define spice_displays 0 -static inline int qemu_spice_display_add_client(int csock, int skipauth, - int tls) -{ - return -1; -} #endif /* CONFIG_SPICE */ diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index 8ac59977e661..a08143b32335 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -340,7 +340,7 @@ void qmp_add_client(const char *protocol, const char *fdname, } skipauth = has_skipauth ? skipauth : false; tls = has_tls ? tls : false; - if (qemu_spice_display_add_client(fd, skipauth, tls) < 0) { + if (qemu_spice.display_add_client(fd, skipauth, tls) < 0) { error_setg(errp, "spice failed to add client"); close(fd); } diff --git a/ui/spice-core.c b/ui/spice-core.c index 4fe543aba058..99457c226e6f 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -959,7 +959,7 @@ static int qemu_spice_set_pw_expire(time_t expires) return qemu_spice_set_ticket(false, false); } -int qemu_spice_display_add_client(int csock, int skipauth, int tls) +static int qemu_spice_display_add_client(int csock, int skipauth, int tls) { if (tls) { return spice_server_add_ssl_client(spice_server, csock, skipauth); @@ -999,6 +999,7 @@ static struct QemuSpiceOps real_spice_ops = { .migrate_info = qemu_spice_migrate_info, .set_passwd = qemu_spice_set_passwd, .set_pw_expire = qemu_spice_set_pw_expire, + .display_add_client = qemu_spice_display_add_client, .add_interface = qemu_spice_add_interface, }; diff --git a/ui/spice-module.c b/ui/spice-module.c index 299aeb479be5..8fbc99c03c55 100644 --- a/ui/spice-module.c +++ b/ui/spice-module.c @@ -52,10 +52,17 @@ static int qemu_spice_set_pw_expire_stub(time_t expires) return -1; } +static int qemu_spice_display_add_client_stub(int csock, int skipauth, + int tls) +{ + return -1; +} + struct QemuSpiceOps qemu_spice = { .init = qemu_spice_init_stub, .display_init = qemu_spice_display_init_stub, .migrate_info = qemu_spice_migrate_info_stub, .set_passwd = qemu_spice_set_passwd_stub, .set_pw_expire = qemu_spice_set_pw_expire_stub, + .display_add_client = qemu_spice_display_add_client_stub, }; From patchwork Thu Oct 22 05:12:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850257 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 C345392C for ; Thu, 22 Oct 2020 05:13: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 5BBC0223FB for ; Thu, 22 Oct 2020 05:13: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="gYscflQ0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BBC0223FB 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]:36250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVSuu-0005OG-6L for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:13:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVSu4-0003hy-AB for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25100) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVStw-0003ww-9D for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343555; 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=wJlzlctCSWD+0j21f5dbiNPatstrKGJhxTWBIT81Asw=; b=gYscflQ01rlx1hLNtEX1OEnuFaYz+izO+sHQ46Ba/pwd5IEZdYTvEykAIRtP6S/fNTgYUT fnb8/SwALS24rGdrzyxI/eigMXIlD5bz7qBFZOorj7A4WbgB6Cj3F39cjtYCHX0gQzBYyb rA+H3N7lZMs0eKs5b1ebSHX3gtwruGg= 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-230-RK2ApFONOu--FUgF3TmHXg-1; Thu, 22 Oct 2020 01:12:32 -0400 X-MC-Unique: RK2ApFONOu--FUgF3TmHXg-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 8E6C4186DD34 for ; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5262560C15; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D9DBC1FCE5; Thu, 22 Oct 2020 07:12:23 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 08/14] spice: wire up monitor in QemuSpiceOps. Date: Thu, 22 Oct 2020 07:12:17 +0200 Message-Id: <20201022051223.6181-9-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 23:30:42 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H5=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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Rename qmp_query_spice() to qmp_query_spice_real(), add to QemuSpiceOps. Add new qmp_query_spice() function which calls the real function via QemuSpiceOps if available, otherwise return SpiceInfo.enabled = false. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-9-kraxel@redhat.com --- include/ui/qemu-spice-module.h | 3 +++ ui/spice-core.c | 3 ++- ui/spice-module.c | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/ui/qemu-spice-module.h b/include/ui/qemu-spice-module.h index 7422f6404ba0..1f22d557ea2f 100644 --- a/include/ui/qemu-spice-module.h +++ b/include/ui/qemu-spice-module.h @@ -22,6 +22,8 @@ #include #endif +typedef struct SpiceInfo SpiceInfo; + struct QemuSpiceOps { void (*init)(void); void (*display_init)(void); @@ -32,6 +34,7 @@ struct QemuSpiceOps { int (*display_add_client)(int csock, int skipauth, int tls); #ifdef CONFIG_SPICE int (*add_interface)(SpiceBaseInstance *sin); + SpiceInfo* (*qmp_query)(Error **errp); #endif }; diff --git a/ui/spice-core.c b/ui/spice-core.c index 99457c226e6f..eea52f538999 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -502,7 +502,7 @@ static QemuOptsList qemu_spice_opts = { }, }; -SpiceInfo *qmp_query_spice(Error **errp) +static SpiceInfo *qmp_query_spice_real(Error **errp) { QemuOpts *opts = QTAILQ_FIRST(&qemu_spice_opts.head); int port, tls_port; @@ -1001,6 +1001,7 @@ static struct QemuSpiceOps real_spice_ops = { .set_pw_expire = qemu_spice_set_pw_expire, .display_add_client = qemu_spice_display_add_client, .add_interface = qemu_spice_add_interface, + .qmp_query = qmp_query_spice_real, }; static void spice_register_config(void) diff --git a/ui/spice-module.c b/ui/spice-module.c index 8fbc99c03c55..32223358722c 100644 --- a/ui/spice-module.c +++ b/ui/spice-module.c @@ -19,6 +19,9 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" +#include "qapi/error.h" +#include "qapi/qapi-types-ui.h" +#include "qapi/qapi-commands-ui.h" #include "ui/qemu-spice-module.h" int using_spice; @@ -66,3 +69,17 @@ struct QemuSpiceOps qemu_spice = { .set_pw_expire = qemu_spice_set_pw_expire_stub, .display_add_client = qemu_spice_display_add_client_stub, }; + +#ifdef CONFIG_SPICE + +SpiceInfo *qmp_query_spice(Error **errp) +{ + if (!qemu_spice.qmp_query) { + SpiceInfo *info = g_new0(SpiceInfo, 1); + info->enabled = false; + return info; + } + return qemu_spice.qmp_query(errp); +} + +#endif From patchwork Thu Oct 22 05:12:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850283 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 CE0DC14B2 for ; Thu, 22 Oct 2020 05:16:01 +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 648802145D for ; Thu, 22 Oct 2020 05:16:01 +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="MMB8ymuV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 648802145D 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]:44782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVSxE-0000V2-Ar for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:16:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVSu6-0003kb-O5 for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVSu3-0003yt-Rr for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343561; 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=BUyCtUoBUGjFpobPgKkFMglbli/wsqfJ9gxw6AfKslE=; b=MMB8ymuV7qeGIU2HNo8JdTJKcdpixEJ7AorRPc97bJprMC8SerCmrrqMc2u8d/46xYS/VP 8fkn6vopavSDp27mFHBiobmakguCy/rm4Xicv3s5D9i0JtYPGIqxcv2N3CbPRnDJ2dhpLv 3eudRvvzWSA9WAmbUyakh7gufm7lUHk= 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-209-UTGrsX_HMomM05r6EpVZoQ-1; Thu, 22 Oct 2020 01:12:40 -0400 X-MC-Unique: UTGrsX_HMomM05r6EpVZoQ-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 056D4107ACF5 for ; Thu, 22 Oct 2020 05:12:39 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E2F15577D; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id E25D91FCF5; Thu, 22 Oct 2020 07:12:23 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 09/14] spice: load module when enabled on the cmdline Date: Thu, 22 Oct 2020 07:12:18 +0200 Message-Id: <20201022051223.6181-10-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-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-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/22 00:54:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" In case the spice opts are not registered, try loading the spice module. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-10-kraxel@redhat.com --- softmmu/vl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 8a06fe8bf77a..14fc527fc6e0 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3705,7 +3705,11 @@ void qemu_init(int argc, char **argv, char **envp) break; } case QEMU_OPTION_spice: - olist = qemu_find_opts("spice"); + olist = qemu_find_opts_err("spice", NULL); + if (!olist) { + ui_module_load_one("spice-core"); + olist = qemu_find_opts("spice"); + } if (!olist) { error_report("spice support is disabled"); exit(1); From patchwork Thu Oct 22 05:12:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850297 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 D424D14B7 for ; Thu, 22 Oct 2020 05:21:40 +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 6E72F2244C for ; Thu, 22 Oct 2020 05:21:40 +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="VX8vUzzO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6E72F2244C 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]:33876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVT2h-0007kT-92 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:21:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVSu7-0003lX-52 for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVStw-0003x9-CH for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343555; 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=QCUAz/WcgThmhSFD6KwM9qtnbIanE8xzkmYEHtCD6ts=; b=VX8vUzzO0dQl9yyXr0j8sBFC1syE1LILmu/Ptb3WVx457A+zq25FkcpJrMMllqN6nnmnF7 cyJSfwEE0jJn18hkqHo7t0dmD9R/WIq9Wzlgh7rhMDxNV4VW6QTGcikt5R0U3RPxZdYKHH XpPgIcGEBx2MKpYGiphX+YRxSv+lYR0= 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-291-yZ4-3fiiP26ma53PKDrH4w-1; Thu, 22 Oct 2020 01:12:32 -0400 X-MC-Unique: yZ4-3fiiP26ma53PKDrH4w-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 CA6E91084D6C for ; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 603586EF62; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id EB0AF204A1; Thu, 22 Oct 2020 07:12:23 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 10/14] modules: dependencies infrastructure Date: Thu, 22 Oct 2020 07:12:19 +0200 Message-Id: <20201022051223.6181-11-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-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-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/22 00:54:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Allow modules depending on other modules. module_load_file() gets the option to export symbols (by not adding the G_MODULE_BIND_LOCAL flag). module_load_one() will check the module dependency list to figure (a) whenever are other modules must be loaded first, or (b) the module should export the symbols. The dependencies are specificed as static list in the source code for now as I expect the list will stay small. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-11-kraxel@redhat.com --- util/module.c | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/util/module.c b/util/module.c index f0ed05fbd06b..0c0f258923dc 100644 --- a/util/module.c +++ b/util/module.c @@ -110,7 +110,7 @@ void module_call_init(module_init_type type) } #ifdef CONFIG_MODULES -static int module_load_file(const char *fname, bool mayfail) +static int module_load_file(const char *fname, bool mayfail, bool export_symbols) { GModule *g_module; void (*sym)(void); @@ -118,7 +118,7 @@ static int module_load_file(const char *fname, bool mayfail) int len = strlen(fname); int suf_len = strlen(dsosuf); ModuleEntry *e, *next; - int ret; + int ret, flags; if (len <= suf_len || strcmp(&fname[len - suf_len], dsosuf)) { /* wrong suffix */ @@ -132,7 +132,11 @@ static int module_load_file(const char *fname, bool mayfail) assert(QTAILQ_EMPTY(&dso_init_list)); - g_module = g_module_open(fname, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); + flags = G_MODULE_BIND_LAZY; + if (!export_symbols) { + flags |= G_MODULE_BIND_LOCAL; + } + g_module = g_module_open(fname, flags); if (!g_module) { if (!mayfail) { fprintf(stderr, "Failed to open module: %s\n", @@ -167,6 +171,12 @@ static int module_load_file(const char *fname, bool mayfail) out: return ret; } + +static const struct { + const char *name; + const char *dep; +} module_deps[] = { +}; #endif bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) @@ -182,7 +192,8 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) char *dirs[5]; char *module_name; int i = 0, n_dirs = 0; - int ret; + int ret, dep; + bool export_symbols = false; static GHashTable *loaded_modules; if (!g_module_supported()) { @@ -196,6 +207,17 @@ 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_add(loaded_modules, module_name)) { g_free(module_name); return true; @@ -220,7 +242,7 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) for (i = 0; i < n_dirs; i++) { fname = g_strdup_printf("%s/%s%s", dirs[i], module_name, CONFIG_HOST_DSOSUF); - ret = module_load_file(fname, mayfail); + ret = module_load_file(fname, mayfail, export_symbols); g_free(fname); fname = NULL; /* Try loading until loaded a module file */ From patchwork Thu Oct 22 05:12:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850279 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 F2D7614B2 for ; Thu, 22 Oct 2020 05:15:58 +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 8B76C2145D for ; Thu, 22 Oct 2020 05:15:58 +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="KUObFf4+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B76C2145D 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]:44482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVSxB-0000NG-8C for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:15:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVSu9-0003mm-3U for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29080) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVStv-0003wJ-BB for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343554; 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=GLDKr3bJJcW7BQ8I0BkGaifRf+4XyADj4mdQgXyXSzQ=; b=KUObFf4+d6+Wc0a/F+D4+ITAr+08/mKA+0E+AdxhPl8HymLykEmhVG7uHUNX521ItUTFoF H1QOgWNuGyVXqVb4pPIJeTdbUsGBU8yODRpAEqn9J2owLLBRwlRPWmjmo98RG8VDbawIVU RH/RdP7o3fGOzH9CyRRM9IIfXh2khjo= 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-41-BTJxZpHPMHKX3CnfcQhyrg-1; Thu, 22 Oct 2020 01:12:32 -0400 X-MC-Unique: BTJxZpHPMHKX3CnfcQhyrg-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 979BB1006CA3 for ; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F2D760C47; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id F3762204A6; Thu, 22 Oct 2020 07:12:23 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 11/14] modules: add spice dependencies Date: Thu, 22 Oct 2020 07:12:20 +0200 Message-Id: <20201022051223.6181-12-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/22 00:54:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-12-kraxel@redhat.com --- util/module.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/module.c b/util/module.c index 0c0f258923dc..21237dcc24df 100644 --- a/util/module.c +++ b/util/module.c @@ -176,6 +176,11 @@ 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" }, }; #endif From patchwork Thu Oct 22 05:12:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850293 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 B645C14B7 for ; Thu, 22 Oct 2020 05:19:17 +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 6233B223FB for ; Thu, 22 Oct 2020 05:19:17 +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="JZpGfif4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6233B223FB 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]:57910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVT0O-0005tJ-9p for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:19:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVSu6-0003kO-Kd for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56348) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVStv-0003wR-L3 for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343555; 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=64f7Avxke8Zz3NS9yGXFYLUZfTJGps7pBALxKZB9KPU=; b=JZpGfif46sD3d3x1Tc+vE4Q0EcCdBqTRC4u265freZX5QFOR22bCWNM5lM58gBo1LNH5e8 +ogGPqHzm4UcOTrVe0BdoQxFPecJNL3puyfuxuKOplXqk58HWyFEZflmFUVJggQTD/zC9C 4+xXDIYj+luAtfa1CHBXSi31Pn7zSoc= 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-41-w0Jvt8xVMZK9KwU5ZbV0Tg-1; Thu, 22 Oct 2020 01:12:32 -0400 X-MC-Unique: w0Jvt8xVMZK9KwU5ZbV0Tg-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 A190A803F76 for ; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D16A1002C04; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 07D98204A7; Thu, 22 Oct 2020 07:12:24 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 12/14] spice: flip modules switch Date: Thu, 22 Oct 2020 07:12:21 +0200 Message-Id: <20201022051223.6181-13-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-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-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/22 00:54:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Build spice core code as module. This removes libspice-server and a handful of indirect dependencies from core qemu. The number of shared libraries for qemu-system-x86_64 goes down from 73 to 66 on my system. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-13-kraxel@redhat.com --- ui/meson.build | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/meson.build b/ui/meson.build index e89e298643a3..509739709ef2 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -15,7 +15,6 @@ softmmu_ss.add(files( softmmu_ss.add([spice_headers, files('spice-module.c')]) softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('input-linux.c')) -softmmu_ss.add(when: [spice, 'CONFIG_SPICE'], if_true: files('spice-core.c', 'spice-input.c', 'spice-display.c')) softmmu_ss.add(when: cocoa, if_true: files('cocoa.m')) vnc_ss = ss.source_set() @@ -71,6 +70,16 @@ if sdl.found() ui_modules += {'sdl' : sdl_ss} endif +if config_host.has_key('CONFIG_SPICE') + spice_core_ss = ss.source_set() + spice_core_ss.add(spice, pixman, files( + 'spice-core.c', + 'spice-input.c', + 'spice-display.c' + )) + ui_modules += {'spice-core' : spice_core_ss} +endif + if config_host.has_key('CONFIG_SPICE') and config_host.has_key('CONFIG_GIO') spice_ss = ss.source_set() spice_ss.add(spice, gio, pixman, files('spice-app.c')) From patchwork Thu Oct 22 05:12:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850285 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 BEB9114B7 for ; Thu, 22 Oct 2020 05:17:21 +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 7C59A2145D for ; Thu, 22 Oct 2020 05:17:21 +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="N3yRS30p" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C59A2145D 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]:49984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVSyW-0002eA-HF for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:17:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVSu2-0003gY-Ar for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22731) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVStv-0003wN-Ok for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343554; 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=A4JWyfQaTHTv6dNADFnmLNjiPR9m/s3N8HkkSrAs1pA=; b=N3yRS30pWDeg2citlTw//RvkTifYW7uMFr5rP7fZHcYQHStCIVwkHBn+Hr0MHHye6rR12B J62noT07CIXPb52q5rn3LESr4K/r1uv3LLt6Wd9VMcjR7fLgXc9/f38g1Jn8fmVl0VGHx9 dc0n3sJBlPzbI63jMicGrD/SUtnP03A= 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-218-5EXgWAusMVeLCdSaTn9LKQ-1; Thu, 22 Oct 2020 01:12:32 -0400 X-MC-Unique: 5EXgWAusMVeLCdSaTn9LKQ-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 DEDEC186DD3C for ; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F0771001281; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 10A91204AC; Thu, 22 Oct 2020 07:12:24 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 13/14] opengl: build egl-headless display modular Date: Thu, 22 Oct 2020 07:12:22 +0200 Message-Id: <20201022051223.6181-14-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 23:30:42 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H5=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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-14-kraxel@redhat.com --- ui/meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/meson.build b/ui/meson.build index 509739709ef2..537e5e067358 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -34,7 +34,6 @@ vnc_ss.add(when: sasl, if_true: files('vnc-auth-sasl.c')) softmmu_ss.add_all(when: vnc, if_true: vnc_ss) softmmu_ss.add(when: vnc, if_false: files('vnc-stubs.c')) softmmu_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('shader.c', 'console-gl.c', 'egl-helpers.c', 'egl-context.c')) -softmmu_ss.add(when: [opengl, 'CONFIG_OPENGL_DMABUF'], if_true: files('egl-headless.c')) specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: opengl) ui_modules = {} @@ -45,6 +44,13 @@ if curses.found() ui_modules += {'curses' : curses_ss} endif +if config_host.has_key('CONFIG_OPENGL_DMABUF') + egl_headless_ss = ss.source_set() + egl_headless_ss.add(when: [opengl, pixman, 'CONFIG_OPENGL_DMABUF'], + if_true: files('egl-headless.c')) + ui_modules += {'egl-headless' : egl_headless_ss} +endif + if config_host.has_key('CONFIG_GTK') softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c')) From patchwork Thu Oct 22 05:12:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11850289 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 5EB6914B2 for ; Thu, 22 Oct 2020 05:18:04 +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 0BF46223FB for ; Thu, 22 Oct 2020 05:18: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="KxFfQCUO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0BF46223FB 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]:52872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVSzD-0003ny-1b for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Oct 2020 01:18:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVSuB-0003qI-DR for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56247) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kVSu6-0003z3-Ea for qemu-devel@nongnu.org; Thu, 22 Oct 2020 01:12:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603343563; 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=EHE9b9eKVG1dzNaFL1EsNVc3kfeOK24WmnbkwRy//wk=; b=KxFfQCUOqwmq2xfWbS5Y58Yk3cLrdygs85p6uDeUZphmmfjpB5udlLvLAEXhMM9dRXsBp4 JIUgnH4uC05u+si8Q8GtdSzC0fSzMG7C/fnMEShsl9aPQmhqJhcIb46RjS+2IBz4ZEftHa zhPQ9E2QyBAoGXNrYSmTBgbw06kUA1U= 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-492-66_aL5dYNryDdnAoz6cUVw-1; Thu, 22 Oct 2020 01:12:41 -0400 X-MC-Unique: 66_aL5dYNryDdnAoz6cUVw-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 49465186DD29 for ; Thu, 22 Oct 2020 05:12:40 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-114-66.ams2.redhat.com [10.36.114.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id A08305B4B8; Thu, 22 Oct 2020 05:12:31 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 21AEF204AD; Thu, 22 Oct 2020 07:12:24 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 14/14] opengl: build opengl helper code modular Date: Thu, 22 Oct 2020 07:12:23 +0200 Message-Id: <20201022051223.6181-15-kraxel@redhat.com> In-Reply-To: <20201022051223.6181-1-kraxel@redhat.com> References: <20201022051223.6181-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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 23:30:42 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H5=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: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Markus Armbruster , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Removes opengl dependency from core qemu. The number of shared libraries for qemu-system-x86_64 goes down from 66 to 60 on my system. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-15-kraxel@redhat.com --- util/module.c | 7 +++++++ ui/meson.build | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/util/module.c b/util/module.c index 21237dcc24df..fe3b82dd4d37 100644 --- a/util/module.c +++ b/util/module.c @@ -181,6 +181,13 @@ static const struct { { "hw-display-qxl", "ui-spice-core" }, { "ui-spice-app", "ui-spice-core" }, { "ui-spice-app", "chardev-spice" }, + +#ifdef CONFIG_OPENGL + { "ui-egl-headless", "ui-opengl" }, + { "ui-gtk", "ui-opengl" }, + { "ui-sdl", "ui-opengl" }, + { "ui-spice-core", "ui-opengl" }, +#endif }; #endif diff --git a/ui/meson.build b/ui/meson.build index 537e5e067358..5d4906c023b9 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -33,7 +33,6 @@ vnc_ss.add(zlib, png, jpeg) vnc_ss.add(when: sasl, if_true: files('vnc-auth-sasl.c')) softmmu_ss.add_all(when: vnc, if_true: vnc_ss) softmmu_ss.add(when: vnc, if_false: files('vnc-stubs.c')) -softmmu_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('shader.c', 'console-gl.c', 'egl-helpers.c', 'egl-context.c')) specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: opengl) ui_modules = {} @@ -44,6 +43,13 @@ if curses.found() ui_modules += {'curses' : curses_ss} endif +if config_host.has_key('CONFIG_OPENGL') + opengl_ss = ss.source_set() + opengl_ss.add(when: [opengl, pixman, 'CONFIG_OPENGL'], + if_true: files('shader.c', 'console-gl.c', 'egl-helpers.c', 'egl-context.c')) + ui_modules += {'opengl' : opengl_ss} +endif + if config_host.has_key('CONFIG_OPENGL_DMABUF') egl_headless_ss = ss.source_set() egl_headless_ss.add(when: [opengl, pixman, 'CONFIG_OPENGL_DMABUF'],