From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: [PATCH 05/14] spice: move add_interface() to QemuSpiceOps.
Date: Mon, 19 Oct 2020 09:52:15 +0200 [thread overview]
Message-ID: <20201019075224.14803-6-kraxel@redhat.com> (raw)
In-Reply-To: <20201019075224.14803-1-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <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 <spice.h>
+#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;
--
2.27.0
next prev parent reply other threads:[~2020-10-19 8:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 7:52 [PATCH 00/14] ui: build spice and opengl as module Gerd Hoffmann
2020-10-19 7:52 ` [PATCH 01/14] spice: add module helpers Gerd Hoffmann
2020-10-19 7:52 ` [PATCH 02/14] spice: add QemuSpiceOps, move migrate_info Gerd Hoffmann
2020-10-19 10:17 ` Dr. David Alan Gilbert
2020-10-19 7:52 ` [PATCH 03/14] spice: move qemu_spice_init() to QemuSpiceOps Gerd Hoffmann
2020-10-19 7:52 ` [PATCH 04/14] spice: move display_init() " Gerd Hoffmann
2020-10-19 7:52 ` Gerd Hoffmann [this message]
2020-10-19 7:52 ` [PATCH 06/14] spice: move auth functions " Gerd Hoffmann
2020-10-19 7:52 ` [PATCH 07/14] spice: move display_add_client() " Gerd Hoffmann
2020-10-19 7:52 ` [PATCH 08/14] spice: wire up monitor in QemuSpiceOps Gerd Hoffmann
2020-10-19 7:52 ` [PATCH 09/14] spice: load module when enabled on the cmdline Gerd Hoffmann
2020-10-19 7:52 ` [PATCH 10/14] modules: dependencies infrastructure Gerd Hoffmann
2020-10-19 7:52 ` [PATCH 11/14] modules: add spice dependencies Gerd Hoffmann
2020-10-19 7:52 ` [PATCH 12/14] spice: flip modules switch Gerd Hoffmann
2020-10-19 7:52 ` [PATCH 13/14] opengl: build egl-headless display modular Gerd Hoffmann
2020-10-19 7:52 ` [PATCH 14/14] opengl: build opengl helper code modular Gerd Hoffmann
2020-10-20 9:59 ` [PATCH 00/14] ui: build spice and opengl as module Marc-André Lureau
2020-10-26 16:27 ` Bruce Rogers
2020-10-27 5:58 ` Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201019075224.14803-6-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).