aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
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 /monitor.c
parentcfb41c82ab9c468e599d3603ffcebeb81b6577ca (diff)
parentcbcc6336ce9e5c048821b136649712e078c4d05f (diff)
downloadqemu-9363ee31ab53fc0fd39fbe5936d9c00a2f4e54a4.zip
qemu-9363ee31ab53fc0fd39fbe5936d9c00a2f4e54a4.tar.gz
qemu-9363ee31ab53fc0fd39fbe5936d9c00a2f4e54a4.tar.bz2
Merge remote branch 'spice/spice.v29.pull' into staging
Conflicts: trace-events
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index 64e41e3..acbe0e6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1146,9 +1146,9 @@ static int expire_password(Monitor *mon, const QDict *qdict, QObject **ret_data)
time_t when;
int rc;
- if (strcmp(whenstr, "now")) {
+ if (strcmp(whenstr, "now") == 0) {
when = 0;
- } else if (strcmp(whenstr, "never")) {
+ } else if (strcmp(whenstr, "never") == 0) {
when = TIME_MAX;
} else if (whenstr[0] == '+') {
when = time(NULL) + strtoull(whenstr+1, NULL, 10);
@@ -1183,6 +1183,33 @@ static int expire_password(Monitor *mon, const QDict *qdict, QObject **ret_data)
return -1;
}
+static int client_migrate_info(Monitor *mon, const QDict *qdict, QObject **ret_data)
+{
+ const char *protocol = qdict_get_str(qdict, "protocol");
+ const char *hostname = qdict_get_str(qdict, "hostname");
+ const char *subject = qdict_get_try_str(qdict, "cert-subject");
+ int port = qdict_get_try_int(qdict, "port", -1);
+ int tls_port = qdict_get_try_int(qdict, "tls-port", -1);
+ int ret;
+
+ if (strcmp(protocol, "spice") == 0) {
+ if (!using_spice) {
+ qerror_report(QERR_DEVICE_NOT_ACTIVE, "spice");
+ return -1;
+ }
+
+ ret = qemu_spice_migrate_info(hostname, port, tls_port, subject);
+ if (ret != 0) {
+ qerror_report(QERR_UNDEFINED_ERROR);
+ return -1;
+ }
+ return 0;
+ }
+
+ qerror_report(QERR_INVALID_PARAMETER, "protocol");
+ return -1;
+}
+
static int do_screen_dump(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
vga_hw_screen_dump(qdict_get_str(qdict, "filename"));