aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-02-01 15:22:48 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2011-02-01 15:22:48 -0600
commit9363ee31ab53fc0fd39fbe5936d9c00a2f4e54a4 (patch)
tree77c55ab45310cbeced2a05e1f85a109bf2efd481 /ui
parentcfb41c82ab9c468e599d3603ffcebeb81b6577ca (diff)
parentcbcc6336ce9e5c048821b136649712e078c4d05f (diff)
Merge remote branch 'spice/spice.v29.pull' into staging
Conflicts: trace-events
Diffstat (limited to 'ui')
-rw-r--r--ui/qemu-spice.h7
-rw-r--r--ui/spice-core.c25
2 files changed, 32 insertions, 0 deletions
diff --git a/ui/qemu-spice.h b/ui/qemu-spice.h
index 48239c3dbd..916e5dce21 100644
--- a/ui/qemu-spice.h
+++ b/ui/qemu-spice.h
@@ -24,6 +24,7 @@
#include "qemu-option.h"
#include "qemu-config.h"
+#include "qemu-char.h"
extern int using_spice;
@@ -35,15 +36,21 @@ int qemu_spice_add_interface(SpiceBaseInstance *sin);
int qemu_spice_set_passwd(const char *passwd,
bool fail_if_connected, bool disconnect_if_connected);
int qemu_spice_set_pw_expire(time_t expires);
+int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
+ const char *subject);
void do_info_spice_print(Monitor *mon, const QObject *data);
void do_info_spice(Monitor *mon, QObject **ret_data);
+CharDriverState *qemu_chr_open_spice(QemuOpts *opts);
+
#else /* CONFIG_SPICE */
#define using_spice 0
#define qemu_spice_set_passwd(_p, _f1, _f2) (-1)
#define qemu_spice_set_pw_expire(_e) (-1)
+static inline int qemu_spice_migrate_info(const char *h, int p, int t, const char *s)
+{ return -1; }
#endif /* CONFIG_SPICE */
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 27a1ced430..1aa1a5ed18 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -30,11 +30,15 @@
#include "qbool.h"
#include "qstring.h"
#include "qjson.h"
+#include "notify.h"
+#include "migration.h"
#include "monitor.h"
+#include "hw/hw.h"
/* core bits */
static SpiceServer *spice_server;
+static Notifier migration_state;
static const char *auth = "spice";
static char *auth_passwd;
static time_t auth_expires = TIME_MAX;
@@ -416,6 +420,24 @@ void do_info_spice(Monitor *mon, QObject **ret_data)
*ret_data = QOBJECT(server);
}
+static void migration_state_notifier(Notifier *notifier)
+{
+ int state = get_migration_state();
+
+ if (state == MIG_STATE_COMPLETED) {
+#if SPICE_SERVER_VERSION >= 0x000701 /* 0.7.1 */
+ spice_server_migrate_switch(spice_server);
+#endif
+ }
+}
+
+int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
+ const char *subject)
+{
+ return spice_server_migrate_info(spice_server, hostname,
+ port, tls_port, subject);
+}
+
static int add_channel(const char *name, const char *value, void *opaque)
{
int security = 0;
@@ -573,6 +595,9 @@ void qemu_spice_init(void)
spice_server_init(spice_server, &core_interface);
using_spice = 1;
+ migration_state.notify = migration_state_notifier;
+ add_migration_state_change_notifier(&migration_state);
+
qemu_spice_input_init();
qemu_spice_audio_init();