From 2e31e210a8590461d428855426a04dfa49717b51 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 19 Oct 2020 09:52:11 +0200 Subject: spice: add module helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ui/meson.build | 1 + ui/spice-core.c | 1 - ui/spice-module.c | 23 +++++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 ui/spice-module.c (limited to 'ui') diff --git a/ui/meson.build b/ui/meson.build index ab4de98b38..e89e298643 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')) diff --git a/ui/spice-core.c b/ui/spice-core.c index 47700b2200..a7fa574358 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 0000000000..f86b0ac517 --- /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; -- cgit v1.2.3 From 7477477ca7bbf42588575039edcac852fbdb1d75 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 19 Oct 2020 09:52:12 +0200 Subject: spice: add QemuSpiceOps, move migrate_info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ui/spice-core.c | 5 +++++ ui/spice-module.c | 10 ++++++++++ 2 files changed, 15 insertions(+) (limited to 'ui') diff --git a/ui/spice-core.c b/ui/spice-core.c index a7fa574358..b03d743cf9 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 f86b0ac517..f1939545a6 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, +}; -- cgit v1.2.3 From 63be30e6d53e78bbe5e21cbf930014ef4844fb31 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 19 Oct 2020 09:52:13 +0200 Subject: spice: move qemu_spice_init() to QemuSpiceOps. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-4-kraxel@redhat.com --- ui/spice-core.c | 3 ++- ui/spice-module.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/spice-core.c b/ui/spice-core.c index b03d743cf9..6ef66eb387 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 f1939545a6..a30fa452ea 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, }; -- cgit v1.2.3 From b192cd1e4f9321b74e1d8b13b94a239a4750abfb Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 19 Oct 2020 09:52:14 +0200 Subject: spice: move display_init() to QemuSpiceOps. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-5-kraxel@redhat.com --- ui/spice-core.c | 1 + ui/spice-module.c | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'ui') diff --git a/ui/spice-core.c b/ui/spice-core.c index 6ef66eb387..82d5dbda3e 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 a30fa452ea..56868aaffe 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, }; -- cgit v1.2.3 From 05b53636d01c1c9b650465def20b683ea1382f63 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 19 Oct 2020 09:52:15 +0200 Subject: spice: move add_interface() to QemuSpiceOps. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-6-kraxel@redhat.com --- ui/spice-core.c | 5 +++-- ui/spice-input.c | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'ui') diff --git a/ui/spice-core.c b/ui/spice-core.c index 82d5dbda3e..483d880a33 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 21990fa996..bbd502564e 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; -- cgit v1.2.3 From 08ad262643bb925e7f0437630f81b6d1f3acd936 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 19 Oct 2020 09:52:16 +0200 Subject: spice: move auth functions to QemuSpiceOps. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ui/spice-core.c | 10 ++++++---- ui/spice-module.c | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/spice-core.c b/ui/spice-core.c index 483d880a33..4fe543aba0 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 56868aaffe..299aeb479b 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, }; -- cgit v1.2.3 From 864a024c69da2bcf77ecfd0d8bd77f628ded5ba0 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 19 Oct 2020 09:52:17 +0200 Subject: spice: move display_add_client() to QemuSpiceOps. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20201019075224.14803-8-kraxel@redhat.com --- ui/spice-core.c | 3 ++- ui/spice-module.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/spice-core.c b/ui/spice-core.c index 4fe543aba0..99457c226e 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 299aeb479b..8fbc99c03c 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, }; -- cgit v1.2.3 From db5732c9cfcbf109ff97ee392c285a4675ffe398 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 19 Oct 2020 09:52:18 +0200 Subject: spice: wire up monitor in QemuSpiceOps. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ui/spice-core.c | 3 ++- ui/spice-module.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/spice-core.c b/ui/spice-core.c index 99457c226e..eea52f5389 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 8fbc99c03c..3222335872 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 -- cgit v1.2.3 From cbe5fa11789035c43fd2108ac6f45848954954b5 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 19 Oct 2020 09:52:22 +0200 Subject: spice: flip modules switch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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(-) (limited to 'ui') diff --git a/ui/meson.build b/ui/meson.build index e89e298643..509739709e 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')) -- cgit v1.2.3 From 39d41e855ba1e062e828ed3dbc6a1d4f57169c0b Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 19 Oct 2020 09:52:23 +0200 Subject: opengl: build egl-headless display modular MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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(-) (limited to 'ui') diff --git a/ui/meson.build b/ui/meson.build index 509739709e..537e5e0673 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')) -- cgit v1.2.3 From c8263659f1268a0f3502568d7663f722b2461935 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 19 Oct 2020 09:52:24 +0200 Subject: opengl: build opengl helper code modular MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ui/meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/meson.build b/ui/meson.build index 537e5e0673..5d4906c023 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'], -- cgit v1.2.3