}
+int
+qemuMonitorQueryDump(qemuMonitorPtr mon,
+ qemuMonitorDumpStatsPtr stats)
+{
+ QEMU_CHECK_MONITOR_JSON(mon);
+
+ return qemuMonitorJSONQueryDump(mon, stats);
+}
+
+
/**
* Returns 1 if @capability is supported, 0 if it's not, or -1 on error.
*/
int qemuMonitorGetDumpGuestMemoryCapability(qemuMonitorPtr mon,
const char *capability);
+int qemuMonitorQueryDump(qemuMonitorPtr mon,
+ qemuMonitorDumpStatsPtr stats);
+
int qemuMonitorDumpToFd(qemuMonitorPtr mon,
int fd,
const char *dumpformat);
return ret;
}
+
+/* qemuMonitorJSONQueryDump:
+ * @mon: Monitor pointer
+ * @stats: Monitor dump stats
+ *
+ * Attempt to make a "query-dump" call, check for errors, and get/return
+ * the current from the reply
+ *
+ * Returns: 0 on success, -1 on failure
+ */
+int
+qemuMonitorJSONQueryDump(qemuMonitorPtr mon,
+ qemuMonitorDumpStatsPtr stats)
+{
+ virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-dump", NULL);
+ virJSONValuePtr reply = NULL;
+ virJSONValuePtr result = NULL;
+ int ret = -1;
+
+ if (!cmd)
+ return -1;
+
+ if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
+ goto cleanup;
+
+ if (qemuMonitorJSONCheckError(cmd, reply) < 0)
+ goto cleanup;
+
+ result = virJSONValueObjectGetObject(reply, "return");
+
+ ret = qemuMonitorJSONExtractDumpStats(result, stats);
+
+ cleanup:
+ virJSONValueFree(cmd);
+ virJSONValueFree(reply);
+ return ret;
+}
+
+
int
qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitorPtr mon,
const char *capability)
int qemuMonitorJSONMigrateCancel(qemuMonitorPtr mon);
+int qemuMonitorJSONQueryDump(qemuMonitorPtr mon,
+ qemuMonitorDumpStatsPtr stats);
+
int qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitorPtr mon,
const char *capability);