@@ -895,13 +895,24 @@ static int qemu_spice_set_ticket(bool fail_if_conn, bool disconnect_if_conn)
int qemu_spice_set_passwd(const char *passwd,
bool fail_if_conn, bool disconnect_if_conn)
{
- if (strcmp(auth, "spice") != 0) {
+ if (strcmp(auth, "spice") != 0 && strcmp(auth, "none") != 0) {
return -1;
}
g_free(auth_passwd);
auth_passwd = g_strdup(passwd);
- return qemu_spice_set_ticket(fail_if_conn, disconnect_if_conn);
+
+ if (!passwd) {
+ if (spice_server_set_noauth(spice_server) < 0)
+ return -1;
+ auth = "none";
+ } else {
+ if (qemu_spice_set_ticket(fail_if_conn, disconnect_if_conn) < 0)
+ return -1;
+ auth = "spice";
+ }
+
+ return 0;
}
int qemu_spice_set_pw_expire(time_t expires)
This is quite easy. SPICE has a function to disable ticketing. So, if no password was provided, call the function, and if a password was provided, call another function to actually set it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- ui/spice-core.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)