From 7d1145a69ffc7cad90e85b126e3b6df599bfa7fd Mon Sep 17 00:00:00 2001
Message-Id: <7d1145a69ffc7cad90e85b126e3b6df599bfa7fd.1424811078.git.jen@redhat.com>
In-Reply-To: <daa093cf3b29cc36a29e8aa34d6b64db07eee8be.1424811078.git.jen@redhat.com>
References: <daa093cf3b29cc36a29e8aa34d6b64db07eee8be.1424811078.git.jen@redhat.com>
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Wed, 18 Feb 2015 10:25:44 -0500
Subject: [CHANGE 2/4] spice: set spice uuid and name
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: <1424255144-8062-2-git-send-email-kraxel@redhat.com>
Patchwork-id: 63887
O-Subject: [RHEL-6.7 qemu-kvm PATCH 1/1] spice: set spice uuid and name
Bugzilla: 1129780
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Bandan Das <bsd@redhat.com>
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>

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

This allows a Spice client to identify a VM

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit d0638b185c92a3fa8c82c2ef229312e9dbbd555c)
Signed-off-by: Jeff E. Nelson <jen@redhat.com>

Conflicts:
	ui/spice-core.c
---
 ui/spice-core.c | 5 +++++
 1 file changed, 5 insertions(+)

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

diff --git a/ui/spice-core.c b/ui/spice-core.c
index befecc2..884ef4a 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -20,6 +20,7 @@
 
 #include <netdb.h>
 #include <pthread.h>
+#include "sysemu.h"
 
 #include "qemu-common.h"
 #include "qemu-spice.h"
@@ -800,6 +801,10 @@ void qemu_spice_init(void)
     seamless_migration = qemu_opt_get_bool(opts, "seamless-migration", 0);
     spice_server_set_seamless_migration(spice_server, seamless_migration);
 #endif
+#if SPICE_SERVER_VERSION >= 0x000a02 /* 0.10.2 */
+    spice_server_set_name(spice_server, qemu_name);
+    spice_server_set_uuid(spice_server, qemu_uuid);
+#endif
 
     if (0 != spice_server_init(spice_server, &core_interface)) {
         fprintf(stderr, "failed to initialize spice server");
-- 
2.1.0

