[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC][PATCH 09/15] introduce a new monitor command 'dum
From: |
Wen Congyang |
Subject: |
Re: [Qemu-devel] [RFC][PATCH 09/15] introduce a new monitor command 'dump' to dump guest's memory |
Date: |
Mon, 30 Jan 2012 13:36:52 +0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100413 Fedora/3.0.4-2.fc13 Thunderbird/3.0.4 |
At 01/20/2012 12:32 AM, Eric Blake Wrote:
> On 01/18/2012 08:07 PM, Wen Congyang wrote:
>> Signed-off-by: Wen Congyang <address@hidden>
>> ---
>> Makefile.target | 8 +-
>> dump.c | 590
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> dump.h | 3 +
>> hmp-commands.hx | 16 ++
>> hmp.c | 9 +
>> hmp.h | 1 +
>> monitor.c | 3 +
>> qapi-schema.json | 13 ++
>> qmp-commands.hx | 26 +++
>> 9 files changed, 665 insertions(+), 4 deletions(-)
>> create mode 100644 dump.c
>>
>
>> +void qmp_dump(const char *file, Error **errp)
>> +{
>> + const char *p;
>> + int fd = -1;
>> + DumpState *s;
>> +
>> +#if !defined(WIN32)
>> + if (strstart(file, "fd:", &p)) {
>> + fd = qemu_get_fd(p);
>> + if (fd == -1) {
>> + error_set(errp, QERR_FD_NOT_FOUND, p);
>> + return;
>> + }
>> + }
>> +#endif
>
> Thanks for implementing fd support off the bat.
>
>> +
>> + if (strstart(file, "file:", &p)) {
>> + fd = open(p, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY);
>
> Use of O_CREAT requires that you pass a third argument to open()
> specifying the mode_t to use.
Yes, I forgot it, and will fix it.
>
>> +++ b/hmp-commands.hx
>> @@ -828,6 +828,22 @@ new parameters (if specified) once the vm migration
>> finished successfully.
>> ETEXI
>>
>> {
>> + .name = "dump",
>> + .args_type = "file:s",
>> + .params = "file",
>> + .help = "dump to file",
>> + .user_print = monitor_user_noop,
>> + .mhandler.cmd = hmp_dump,
>> + },
>
> What if I want to dump only a fraction of the memory? I think you need
> optional start and length parameters, to limit how much memory to be
> dumped, rather than forcing me to dump all memory at once.
>
It is OK to support it, but I do not know why do you want it?
The purpose of this command is dumping the memory when the guest is paniced.
And then we can use crash/gdb(or other application) to investigate why the guest
is paniced. So we should dump the whole memory.
Thanks
Wen Congyang
- [Qemu-devel] [RFC][PATCH 04/15] target-i386: implement cpu_get_memory_mapping(), (continued)
- [Qemu-devel] [RFC][PATCH 04/15] target-i386: implement cpu_get_memory_mapping(), Wen Congyang, 2012/01/18
- [Qemu-devel] [RFC][PATCH 05/15] Add API to get memory mapping, Wen Congyang, 2012/01/18
- [Qemu-devel] [RFC][PATCH 06/15] target-i386: Add API to write elf notes to core file, Wen Congyang, 2012/01/18
- [Qemu-devel] [RFC][PATCH 08/15] target-i386: add API to get dump info, Wen Congyang, 2012/01/18
- [Qemu-devel] [RFC][PATCH 07/15] target-i386: Add API to add extra memory mapping, Wen Congyang, 2012/01/18
- [Qemu-devel] [RFC][PATCH 11/15 v5] support detached dump, Wen Congyang, 2012/01/18
- [Qemu-devel] [RFC][PATCH 13/15 v5] support to set dumping speed, Wen Congyang, 2012/01/18
- [Qemu-devel] [RFC][PATCH 14/15 v5] support to query dumping status, Wen Congyang, 2012/01/18
- [Qemu-devel] [RFC][PATCH 09/15] introduce a new monitor command 'dump' to dump guest's memory, Wen Congyang, 2012/01/18
[Qemu-devel] [RFC][PATCH 12/15 v5] support to cancel the current dumping, Wen Congyang, 2012/01/18
[Qemu-devel] [RFC][PATCH 10/15] run dump at the background, Wen Congyang, 2012/01/18
[Qemu-devel] [RFC][PATCH 15/15 v5] auto cancel dumping after vm state is changed to run, Wen Congyang, 2012/01/18
Re: [Qemu-devel] [RFC][PATCH 00/15 v5] introducing a new, dedicated memory dump mechanism, Jun Koi, 2012/01/19