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 07/14] spice: move display_add_client() to QemuSpiceOps.
Date: Mon, 19 Oct 2020 09:52:17 +0200 [thread overview]
Message-ID: <20201019075224.14803-8-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 | 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,
};
--
2.27.0
next prev parent reply other threads:[~2020-10-19 8:11 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 ` [PATCH 05/14] spice: move add_interface() " Gerd Hoffmann
2020-10-19 7:52 ` [PATCH 06/14] spice: move auth functions " Gerd Hoffmann
2020-10-19 7:52 ` Gerd Hoffmann [this message]
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-8-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).