diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-10-19 09:52:17 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-10-21 15:46:14 +0200 |
commit | 864a024c69da2bcf77ecfd0d8bd77f628ded5ba0 (patch) | |
tree | b802119956cb3b4211a992752d247eb71a25bccf | |
parent | 08ad262643bb925e7f0437630f81b6d1f3acd936 (diff) | |
download | qemu-864a024c69da2bcf77ecfd0d8bd77f628ded5ba0.zip qemu-864a024c69da2bcf77ecfd0d8bd77f628ded5ba0.tar.gz qemu-864a024c69da2bcf77ecfd0d8bd77f628ded5ba0.tar.bz2 |
spice: move display_add_client() to QemuSpiceOps.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20201019075224.14803-8-kraxel@redhat.com
-rw-r--r-- | include/ui/qemu-spice-module.h | 1 | ||||
-rw-r--r-- | include/ui/qemu-spice.h | 6 | ||||
-rw-r--r-- | monitor/qmp-cmds.c | 2 | ||||
-rw-r--r-- | ui/spice-core.c | 3 | ||||
-rw-r--r-- | 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 1ea3a99..7422f64 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 921b7a3..2beb792 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 8ac5997..a08143b 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 4fe543a..99457c2 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 299aeb4..8fbc99c 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, }; |