From patchwork Wed Aug 19 02:07:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 31621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id EC910B7B64 for ; Wed, 19 Aug 2009 12:39:51 +1000 (EST) Received: from localhost ([127.0.0.1]:52756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mdb5Y-0003Ym-Mf for incoming@patchwork.ozlabs.org; Tue, 18 Aug 2009 22:39:48 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mdb2E-0002jE-N1 for qemu-devel@nongnu.org; Tue, 18 Aug 2009 22:36:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mdb2A-0002i1-8I for qemu-devel@nongnu.org; Tue, 18 Aug 2009 22:36:22 -0400 Received: from [199.232.76.173] (port=37500 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mdb29-0002hy-WE for qemu-devel@nongnu.org; Tue, 18 Aug 2009 22:36:18 -0400 Received: from [66.187.237.31] (port=53936 helo=mx2.redhat.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mdb29-0004SU-GS for qemu-devel@nongnu.org; Tue, 18 Aug 2009 22:36:17 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7J2AAcP026684 for ; Tue, 18 Aug 2009 22:10:10 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7J2A8VH001616; Tue, 18 Aug 2009 22:10:08 -0400 Received: from localhost.localdomain (vpn1-4-108.ams2.redhat.com [10.36.4.108]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7J2A1t3004927; Tue, 18 Aug 2009 22:10:07 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 19 Aug 2009 04:07:47 +0200 Message-Id: <6fb1bd752889ac5ac963f8bf579bfd23657e4b42.1250646771.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [Qemu-devel] [PATCH 4/6] move do_loadvm() to monitor.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Juan Quintela --- monitor.c | 11 +++++++++++ savevm.c | 11 ----------- sysemu.h | 1 - 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/monitor.c b/monitor.c index 362322b..b8a47ca 100644 --- a/monitor.c +++ b/monitor.c @@ -1776,6 +1776,17 @@ static void do_closefd(Monitor *mon, const char *fdname) fdname); } +static void do_loadvm(Monitor *mon, const char *name) +{ + int saved_vm_running = vm_running; + + vm_stop(0); + + load_vmstate(mon, name); + if (saved_vm_running) + vm_start(); +} + int monitor_get_fd(Monitor *mon, const char *fdname) { mon_fd_t *monfd; diff --git a/savevm.c b/savevm.c index a321136..d0ed2ad 100644 --- a/savevm.c +++ b/savevm.c @@ -1210,17 +1210,6 @@ void load_vmstate(Monitor *mon, const char *name) } } -void do_loadvm(Monitor *mon, const char *name) -{ - int saved_vm_running = vm_running; - - vm_stop(0); - - load_vmstate(mon, name); - if (saved_vm_running) - vm_start(); -} - void do_delvm(Monitor *mon, const char *name) { DriveInfo *dinfo; diff --git a/sysemu.h b/sysemu.h index a20025d..330386c 100644 --- a/sysemu.h +++ b/sysemu.h @@ -51,7 +51,6 @@ extern qemu_irq qemu_system_powerdown; void qemu_system_reset(void); void do_savevm(Monitor *mon, const char *name); -void do_loadvm(Monitor *mon, const char *name); void load_vmstate(Monitor *mon, const char *name); void do_delvm(Monitor *mon, const char *name); void do_info_snapshots(Monitor *mon);