summary refs log tree commit diff stats
path: root/hmp.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-03-05 17:29:02 +0100
committerMarkus Armbruster <armbru@redhat.com>2015-06-02 09:59:13 +0200
commitb8a185bc9a8ecbdc74fd64672e4abdd09a558e1c (patch)
tree08bdaa9804050c7b04641b12291d299a6e0cb20c /hmp.c
parent13cadefbda71e119db79fe0b7a4efd26a6d005bd (diff)
downloadfocaccia-qemu-b8a185bc9a8ecbdc74fd64672e4abdd09a558e1c.tar.gz
focaccia-qemu-b8a185bc9a8ecbdc74fd64672e4abdd09a558e1c.zip
monitor: Convert client_migrate_info to QAPI
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'hmp.c')
-rw-r--r--hmp.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/hmp.c b/hmp.c
index e17852d1f9..5a43f9d2bd 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1250,6 +1250,23 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
     }
 }
 
+void hmp_client_migrate_info(Monitor *mon, const QDict *qdict)
+{
+    Error *err = NULL;
+    const char *protocol = qdict_get_str(qdict, "protocol");
+    const char *hostname = qdict_get_str(qdict, "hostname");
+    bool has_port        = qdict_haskey(qdict, "port");
+    int port             = qdict_get_try_int(qdict, "port", -1);
+    bool has_tls_port    = qdict_haskey(qdict, "tls-port");
+    int tls_port         = qdict_get_try_int(qdict, "tls-port", -1);
+    const char *cert_subject = qdict_get_try_str(qdict, "cert-subject");
+
+    qmp_client_migrate_info(protocol, hostname,
+                            has_port, port, has_tls_port, tls_port,
+                            !!cert_subject, cert_subject, &err);
+    hmp_handle_error(mon, &err);
+}
+
 void hmp_set_password(Monitor *mon, const QDict *qdict)
 {
     const char *protocol  = qdict_get_str(qdict, "protocol");