Now I can run qemu with the memory-backend-file option and use /usr/bin/crash
in "live" mode.
Signed-off-by: Oleg Nesterov <oleg(a)redhat.com>
---
ramdump.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ramdump.c b/ramdump.c
index e9716ae..5501752 100644
--- a/ramdump.c
+++ b/ramdump.c
@@ -242,11 +242,13 @@ int is_ramdump(char *p)
size_t len;
char *pattern;
struct stat64 st;
- int is_raw = 0;
+ int is_raw = 0, is_live = 0;
int err = 0;
if (PREFIX(p, "raw:"))
is_raw = 1;
+ else if (PREFIX(p, "live:"))
+ is_raw = is_live = 1;
if (nodes || !strchr(p, '@'))
return 0;
@@ -290,6 +292,10 @@ int is_ramdump(char *p)
pc->dumpfile = "ramdump";
pc->readmem = read_ramdump;
pc->writemem = NULL;
+ if (is_live) {
+ pc->flags |= LIVE_SYSTEM;
+ pc->live_memsrc = pc->dumpfile;
+ }
}
return nodes;
}
--
2.5.0