]> git.proxmox.com Git - mirror_qemu.git/blobdiff - hmp.c
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20180822-1' into...
[mirror_qemu.git] / hmp.c
diff --git a/hmp.c b/hmp.c
index 91470379512578627ed3d619cbd90b0b0b325bab..4975fa56b05a67efe068395e9c898c1c3cd42216 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -1070,6 +1070,30 @@ void hmp_stop(Monitor *mon, const QDict *qdict)
     qmp_stop(NULL);
 }
 
+void hmp_sync_profile(Monitor *mon, const QDict *qdict)
+{
+    const char *op = qdict_get_try_str(qdict, "op");
+
+    if (op == NULL) {
+        bool on = qsp_is_enabled();
+
+        monitor_printf(mon, "sync-profile is %s\n", on ? "on" : "off");
+        return;
+    }
+    if (!strcmp(op, "on")) {
+        qsp_enable();
+    } else if (!strcmp(op, "off")) {
+        qsp_disable();
+    } else if (!strcmp(op, "reset")) {
+        qsp_reset();
+    } else {
+        Error *err = NULL;
+
+        error_setg(&err, QERR_INVALID_PARAMETER, op);
+        hmp_handle_error(mon, &err);
+    }
+}
+
 void hmp_system_reset(Monitor *mon, const QDict *qdict)
 {
     qmp_system_reset(NULL);