From: Anthony PERARD Subject: Re: =?gb2312?b?u9i4tKO6ICBkZWJ1Z2luZyBhYm91dCBxZW11LWRt?= =?gb2312?b?IGluIHhlbiAzLjQuMg==?= Date: Tue, 20 Dec 2011 13:48:10 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8323328-1334286411-1324388906=:11530" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Stefan Hajnoczi Cc: Xen Devel , =?GB2312?Q?=A1=E8=BDK=EC=B6aware?= <250716708@qq.com>, qemu-devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org --8323328-1334286411-1324388906=:11530 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT On Tue, 20 Dec 2011, Stefan Hajnoczi wrote: > 2011/12/20 ¤終於aware <250716708@qq.com>: > >     I want to create a memory snapshot file (such as mm.snap) of current > > virtual machine and  the mm.snap can be used as a arg of qemu cmd-line for > > restoring the last memory condition. > >     But I am not very clear about the structure of the qemu-dm source code. > > Although observing the output of execution is the straightforward way, high > > frequency of printf  and re-compling is too incovenient to put into effect. > > Please keep qemu-devel@nongnu.org CCed so others can contribute to the > discussion. > > QEMU only deals with virtual memory when simulating an MMU (for > ARM-on-x86 system translation). The device model usually operates on > physical RAM or bus addresses. > > Stefano or Anthony can explain the qemu-dm specifics. It's still not > clear to me what you're trying to observe - qemu-dm is not where I'd > try to observe domain memory under Xen but it's the right place to > observe emulated devices. Cced Xen-devel as well. You can save a domain state using the tool stack (probably `xm save` with Xen 3.4) and restore it as many time as you want. To run gdb on qemu-dm, remplace the /usr/lib/xen/bin/qemu-dm by a script: #!/bin/sh exec gdbserver 0.0.0.0:1234 /usr/lib/xen/bin/qemu-dm.bak $@ And run gdb. `target remote localhost 1234` to connect to gdbserver. With the latest Xen (4.1 and unstable), you can specifie a different device model in the config file instead of remplacing the default binary. Regards, -- Anthony PERARD --8323328-1334286411-1324388906=:11530--