return ret;
}
+int qemuMonitorDumpToFd(qemuMonitorPtr mon,
+ unsigned int flags,
+ int fd,
+ unsigned long long begin,
+ unsigned long long length)
+{
+ int ret;
+ VIR_DEBUG("mon=%p fd=%d flags=%x begin=%llx length=%llx",
+ mon, fd, flags, begin, length);
+
+ if (!mon) {
+ qemuReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("monitor must not be NULL"));
+ return -1;
+ }
+
+ if (!mon->json) {
+ /* We don't have qemuMonitorTextDump(), so we should check mon->json
+ * here.
+ */
+ qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("dump-guest-memory is not supported in text mode"));
+ return -1;
+ }
+
+ if (qemuMonitorSendFileHandle(mon, "dump", fd) < 0)
+ return -1;
+
+ ret = qemuMonitorJSONDump(mon, flags, "fd:dump", begin, length);
+
+ if (ret < 0) {
+ if (qemuMonitorCloseFileHandle(mon, "dump") < 0)
+ VIR_WARN("failed to close dumping handle");
+ }
+
+ return ret;
+}
int qemuMonitorGraphicsRelocate(qemuMonitorPtr mon,
int type,
int qemuMonitorMigrateCancel(qemuMonitorPtr mon);
+typedef enum {
+ QEMU_MONITOR_DUMP_HAVE_FILTER = 1 << 0,
+ QEMU_MONITOR_DUMP_PAGING = 1 << 1,
+ QEMU_MONITOR_DUMP_FLAGS_LAST
+} QEMU_MONITOR_DUMP;
+
+int qemuMonitorDumpToFd(qemuMonitorPtr mon,
+ unsigned int flags,
+ int fd,
+ unsigned long long begin,
+ unsigned long long length);
+
int qemuMonitorGraphicsRelocate(qemuMonitorPtr mon,
int type,
const char *hostname,
return ret;
}
+int qemuMonitorJSONDump(qemuMonitorPtr mon,
+ unsigned int flags,
+ const char *protocol,
+ unsigned long long begin,
+ unsigned long long length)
+{
+ int ret;
+ virJSONValuePtr cmd = NULL;
+ virJSONValuePtr reply = NULL;
+
+ if (flags & QEMU_MONITOR_DUMP_HAVE_FILTER)
+ cmd = qemuMonitorJSONMakeCommand("dump-guest-memory",
+ "b:paging", flags & QEMU_MONITOR_DUMP_PAGING ? 1 : 0,
+ "s:protocol", protocol,
+ "U:begin", begin,
+ "U:length", length,
+ NULL);
+ else
+ cmd = qemuMonitorJSONMakeCommand("dump-guest-memory",
+ "b:paging", flags & QEMU_MONITOR_DUMP_PAGING ? 1 : 0,
+ "s:protocol", protocol,
+ NULL);
+ if (!cmd)
+ return -1;
+
+ ret = qemuMonitorJSONCommand(mon, cmd, &reply);
+
+ if (ret == 0)
+ ret = qemuMonitorJSONCheckError(cmd, reply);
+
+ virJSONValueFree(cmd);
+ virJSONValueFree(reply);
+ return ret;
+}
int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon,
int type,
int qemuMonitorJSONMigrateCancel(qemuMonitorPtr mon);
+int qemuMonitorJSONDump(qemuMonitorPtr mon,
+ unsigned int flags,
+ const char *protocol,
+ unsigned long long begin,
+ unsigned long long length);
+
int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon,
int type,
const char *hostname,