qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Wen Congyang <wency@cn.fujitsu.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>,
	Dave Anderson <anderson@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [RFC][PATCH 09/15] introduce a new monitor command 'dump' to dump guest's memory
Date: Mon, 30 Jan 2012 10:19:21 -0700	[thread overview]
Message-ID: <4F26D119.7040308@redhat.com> (raw)
In-Reply-To: <4F262C74.6010903@cn.fujitsu.com>

[-- Attachment #1: Type: text/plain, Size: 2427 bytes --]

On 01/29/2012 10:36 PM, Wen Congyang wrote:
>>> +++ 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.

That's one purpose, but not the only purpose.  We shouldn't be
artificially constraining things into requiring the entire memory region
in order to use this command.

Libvirt provides virDomainMemoryPeek which currently wraps the 'memsave'
and 'pmemsave' monitor commands, but these commands output raw memory.
Your command is introducing a new memory format into ELF images, and if
'memsave' can already do a subset of memory, it also makes sense for
'dump' to do a subset when creating the ELF image.  That is, if a
management app every has a reason to access a subset of memory, then
this reason exists whether the subset is raw or ELF formatted when
presented to the management app.

Meanwhile, on the libvirt side, the virDomainMemoryPeek API to
management apps is constrained - it sends the data inline with the
command, rather than on a side channel.  Someday, I'd like to enhance
libvirt to have a dump-to-stream command, and reuse the existing libvirt
ability to stream large amounts of data on side channels, in order to
let management apps directly and atomically query a subset of memory
into a file with the desired formatting, rather than the current
approach of constraining the management app to only query 64k at a time
and to have to manually pause the guest if they need to atomically
inspect more memory.

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

  reply	other threads:[~2012-01-30 17:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19  2:50 [Qemu-devel] [RFC][PATCH 00/15 v5] introducing a new, dedicated memory dump mechanism Wen Congyang
2012-01-19  3:06 ` [Qemu-devel] [RFC][PATCH 01/15] monitor: introduce qemu_suspend_monitor()/qemu_resume_monitor() Wen Congyang
2012-01-19  3:06 ` [Qemu-devel] [RFC][PATCH 02/15] Add API to create memory mapping list Wen Congyang
2012-01-19  3:06 ` [Qemu-devel] [RFC][PATCH 03/15] Add API to check whether a physical address is I/O address Wen Congyang
2012-01-19  3:06 ` [Qemu-devel] [RFC][PATCH 04/15] target-i386: implement cpu_get_memory_mapping() Wen Congyang
2012-01-19  3:06 ` [Qemu-devel] [RFC][PATCH 05/15] Add API to get memory mapping Wen Congyang
2012-01-19  3:06 ` [Qemu-devel] [RFC][PATCH 06/15] target-i386: Add API to write elf notes to core file Wen Congyang
2012-01-19  3:06 ` [Qemu-devel] [RFC][PATCH 07/15] target-i386: Add API to add extra memory mapping Wen Congyang
2012-01-19  3:07 ` [Qemu-devel] [RFC][PATCH 08/15] target-i386: add API to get dump info Wen Congyang
2012-01-19  3:07 ` [Qemu-devel] [RFC][PATCH 09/15] introduce a new monitor command 'dump' to dump guest's memory Wen Congyang
2012-01-19 16:32   ` Eric Blake
2012-01-30  5:36     ` Wen Congyang
2012-01-30 17:19       ` Eric Blake [this message]
2012-01-31  1:39         ` Wen Congyang
2012-01-19  3:07 ` [Qemu-devel] [RFC][PATCH 10/15] run dump at the background Wen Congyang
2012-01-19  3:07 ` [Qemu-devel] [RFC][PATCH 11/15 v5] support detached dump Wen Congyang
2012-01-19  3:07 ` [Qemu-devel] [RFC][PATCH 12/15 v5] support to cancel the current dumping Wen Congyang
2012-01-19  3:07 ` [Qemu-devel] [RFC][PATCH 13/15 v5] support to set dumping speed Wen Congyang
2012-01-19  3:07 ` [Qemu-devel] [RFC][PATCH 14/15 v5] support to query dumping status Wen Congyang
2012-01-19  3:07 ` [Qemu-devel] [RFC][PATCH 15/15 v5] auto cancel dumping after vm state is changed to run Wen Congyang
2012-01-19  3:32 ` [Qemu-devel] [RFC][PATCH 00/15 v5] introducing a new, dedicated memory dump mechanism Jun Koi
2012-01-19  3:39   ` Wen Congyang
2012-01-19 16:34     ` Eric Blake
2012-01-30  5:40       ` Wen Congyang
2012-01-30 17:38         ` Eric Blake
2012-01-31  1:35           ` Wen Congyang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F26D119.7040308@redhat.com \
    --to=eblake@redhat.com \
    --cc=anderson@redhat.com \
    --cc=d.hatayama@jp.fujitsu.com \
    --cc=jan.kiszka@siemens.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wency@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).