From nobody Mon Feb 9 11:32:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1493891112610257.88732891865493; Thu, 4 May 2017 02:45:12 -0700 (PDT) Received: from localhost ([::1]:40729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6DJv-0003VJ-BA for importer@patchew.org; Thu, 04 May 2017 05:45:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6DG2-0008H6-I6 for qemu-devel@nongnu.org; Thu, 04 May 2017 05:41:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6DFz-0000ff-I0 for qemu-devel@nongnu.org; Thu, 04 May 2017 05:41:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43690) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6DFz-0000f5-98 for qemu-devel@nongnu.org; Thu, 04 May 2017 05:41:07 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 391867D4E2 for ; Thu, 4 May 2017 09:41:06 +0000 (UTC) Received: from secure.mitica (ovpn-116-25.ams2.redhat.com [10.36.116.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id D21DB1715B; Thu, 4 May 2017 09:41:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 391867D4E2 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 391867D4E2 From: Juan Quintela To: qemu-devel@nongnu.org Date: Thu, 4 May 2017 11:40:48 +0200 Message-Id: <20170504094053.2329-6-quintela@redhat.com> In-Reply-To: <20170504094053.2329-1-quintela@redhat.com> References: <20170504094053.2329-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 04 May 2017 09:41:06 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/10] monitor: Move hmp_loadvm from monitor.c to hmp.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, dgilbert@redhat.com, peterx@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We are going to move the rest of hmp snapshots functions there instead of monitor.c. Signed-off-by: Juan Quintela Reviewed-by: Laurent Vivier Reviewed-by: Dr. David Alan Gilbert --- hmp.c | 13 +++++++++++++ hmp.h | 1 + monitor.c | 13 ------------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/hmp.c b/hmp.c index ab407d6..f6b8738 100644 --- a/hmp.c +++ b/hmp.c @@ -19,6 +19,7 @@ #include "net/eth.h" #include "sysemu/char.h" #include "sysemu/block-backend.h" +#include "sysemu/sysemu.h" #include "qemu/config-file.h" #include "qemu/option.h" #include "qemu/timer.h" @@ -1268,6 +1269,18 @@ void hmp_snapshot_delete_blkdev_internal(Monitor *mo= n, const QDict *qdict) hmp_handle_error(mon, &err); } =20 +void hmp_loadvm(Monitor *mon, const QDict *qdict) +{ + int saved_vm_running =3D runstate_is_running(); + const char *name =3D qdict_get_str(qdict, "name"); + + vm_stop(RUN_STATE_RESTORE_VM); + + if (load_vmstate(name) =3D=3D 0 && saved_vm_running) { + vm_start(); + } +} + void hmp_migrate_cancel(Monitor *mon, const QDict *qdict) { qmp_migrate_cancel(NULL); diff --git a/hmp.h b/hmp.h index 799fd37..385332c 100644 --- a/hmp.h +++ b/hmp.h @@ -63,6 +63,7 @@ void hmp_snapshot_blkdev_internal(Monitor *mon, const QDi= ct *qdict); void hmp_snapshot_delete_blkdev_internal(Monitor *mon, const QDict *qdict); void hmp_drive_mirror(Monitor *mon, const QDict *qdict); void hmp_drive_backup(Monitor *mon, const QDict *qdict); +void hmp_loadvm(Monitor *mon, const QDict *qdict); void hmp_migrate_cancel(Monitor *mon, const QDict *qdict); void hmp_migrate_incoming(Monitor *mon, const QDict *qdict); void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict); diff --git a/monitor.c b/monitor.c index 62c9f81..ce11029 100644 --- a/monitor.c +++ b/monitor.c @@ -37,7 +37,6 @@ #include "net/slirp.h" #include "sysemu/char.h" #include "ui/qemu-spice.h" -#include "sysemu/sysemu.h" #include "sysemu/numa.h" #include "monitor/monitor.h" #include "qemu/config-file.h" @@ -1954,18 +1953,6 @@ void qmp_closefd(const char *fdname, Error **errp) error_setg(errp, QERR_FD_NOT_FOUND, fdname); } =20 -static void hmp_loadvm(Monitor *mon, const QDict *qdict) -{ - int saved_vm_running =3D runstate_is_running(); - const char *name =3D qdict_get_str(qdict, "name"); - - vm_stop(RUN_STATE_RESTORE_VM); - - if (load_vmstate(name) =3D=3D 0 && saved_vm_running) { - vm_start(); - } -} - int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp) { mon_fd_t *monfd; --=20 2.9.3