From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyKEB-0008Fu-4T for qemu-devel@nongnu.org; Fri, 17 Feb 2012 04:35:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RyKE5-0001sn-GG for qemu-devel@nongnu.org; Fri, 17 Feb 2012 04:35:43 -0500 Received: from david.siemens.de ([192.35.17.14]:15206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RyKE5-0001sj-48 for qemu-devel@nongnu.org; Fri, 17 Feb 2012 04:35:37 -0500 Message-ID: <4F3E1F5E.3090304@siemens.com> Date: Fri, 17 Feb 2012 10:35:26 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4F333AAA.1070601@cn.fujitsu.com> <4F333D4B.6090300@cn.fujitsu.com> <4F3AA11C.50408@siemens.com> <4F3E1546.9090303@cn.fujitsu.com> <4F3E1D52.6000105@siemens.com> <4F3E1F71.509@cn.fujitsu.com> In-Reply-To: <4F3E1F71.509@cn.fujitsu.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC][PATCH 09/16 v6] introduce a new monitor command 'dump' to dump guest's memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wen Congyang Cc: Eric Blake , HATAYAMA Daisuke , Dave Anderson , qemu-devel , Luiz Capitulino On 2012-02-17 10:35, Wen Congyang wrote: > At 02/17/2012 05:26 PM, Jan Kiszka Wrote: >> On 2012-02-17 09:52, Wen Congyang wrote: >>>>> +static DumpState *dump_init(int fd, Error **errp) >>>>> +{ >>>>> + CPUState *env; >>>>> + DumpState *s = dump_get_current(); >>>>> + int ret; >>>>> + >>>>> + vm_stop(RUN_STATE_PAUSED); >>>> >>>> I would save the current vm state first and restore it when finished. >>> >>> There is no API to get current vm state. If you want this feature, I will >>> add API to get it. >> >> You are looking for runstate_is_running(). > > Yes. vm_stop() stops the vcpu only when runstate_is_running(). So I think > you need to resume all vcpu after dumping is finished. Yes, but _only_ if runstate_is_running() was true before calling vm_stop. That is my point. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux