From f9eba7663196381a2f3e242e644ae5823d35c521 Mon Sep 17 00:00:00 2001
Message-Id: <f9eba7663196381a2f3e242e644ae5823d35c521.1425415444.git.jen@redhat.com>
In-Reply-To: <da72b8b5c732457ae115fa00a02569ddb42eff9c.1425415444.git.jen@redhat.com>
References: <da72b8b5c732457ae115fa00a02569ddb42eff9c.1425415444.git.jen@redhat.com>
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 19 Feb 2015 16:25:11 -0500
Subject: [CHANGE 2/8] spice: call qemu_spice_set_passwd() during init
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
To: rhvirt-patches@redhat.com,
    jen@redhat.com

RH-Author: Gerd Hoffmann <kraxel@redhat.com>
Message-id: <1424363111-31587-2-git-send-email-kraxel@redhat.com>
Patchwork-id: 63899
O-Subject: [RHEL-6.7 qemu-kvm PATCH 1/1] spice: call qemu_spice_set_passwd() during init
Bugzilla: 1138647
RH-Acked-by: Max Reitz <mreitz@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Uri Lublin <uril@redhat.com>

From: Marc-André Lureau <marcandre.lureau@gmail.com>

Don't call SPICE API directly to set password given in command line, but
use the internal API, saving password for later calls.

This solves losing password when changing expiration in qemu monitor.

https://bugzilla.redhat.com/show_bug.cgi?id=1138639

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 07d49a53b6394941ed833486a3acb5c480d87db2)
---
 ui/spice-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Signed-off-by: Jeff E. Nelson <jen@redhat.com>
---
 ui/spice-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 94f9664..582123d 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -726,7 +726,7 @@ void qemu_spice_init(void)
                              tls_ciphers);
     }
     if (password) {
-        spice_server_set_ticket(spice_server, password, 0, 0, 0);
+        qemu_spice_set_passwd(password, false, false);
     }
     if (qemu_opt_get_bool(opts, "sasl", 0)) {
 #if SPICE_SERVER_VERSION >= 0x000900 /* 0.9.0 */
-- 
2.1.0

