aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-11-22 16:32:37 -0200
committerLuiz Capitulino <lcapitulino@redhat.com>2011-12-06 11:40:00 -0200
commit0cfd6a9ab4356cd2c69bb29b1d70e1fd037bc1f2 (patch)
tree70d50b3eb62d4ad3bdd4ce128d40015299754694 /monitor.c
parent588988736634ad2aa356dafac78f88d1ea68b1a4 (diff)
qapi: Convert memsave
Please, note that the QMP command has a new 'cpu-index' parameter. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/monitor.c b/monitor.c
index 344b196451..727201441d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1370,44 +1370,6 @@ static void do_print(Monitor *mon, const QDict *qdict)
monitor_printf(mon, "\n");
}
-static int do_memory_save(Monitor *mon, const QDict *qdict, QObject **ret_data)
-{
- FILE *f;
- uint32_t size = qdict_get_int(qdict, "size");
- const char *filename = qdict_get_str(qdict, "filename");
- target_long addr = qdict_get_int(qdict, "val");
- uint32_t l;
- CPUState *env;
- uint8_t buf[1024];
- int ret = -1;
-
- env = mon_get_cpu();
-
- f = fopen(filename, "wb");
- if (!f) {
- qerror_report(QERR_OPEN_FILE_FAILED, filename);
- return -1;
- }
- while (size != 0) {
- l = sizeof(buf);
- if (l > size)
- l = size;
- cpu_memory_rw_debug(env, addr, buf, l, 0);
- if (fwrite(buf, 1, l, f) != l) {
- monitor_printf(mon, "fwrite() error in do_memory_save\n");
- goto exit;
- }
- addr += l;
- size -= l;
- }
-
- ret = 0;
-
-exit:
- fclose(f);
- return ret;
-}
-
static int do_physical_memory_save(Monitor *mon, const QDict *qdict,
QObject **ret_data)
{