From nobody Mon Feb 9 11:46:47 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 1493115999318130.63892907470415; Tue, 25 Apr 2017 03:26:39 -0700 (PDT) Received: from localhost ([::1]:48229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2xg5-0005HA-Td for importer@patchew.org; Tue, 25 Apr 2017 06:26:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2xeS-000443-8C for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:24:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2xeR-000342-4W for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:24:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46896) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d2xeQ-00033t-RR for qemu-devel@nongnu.org; Tue, 25 Apr 2017 06:24:55 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D01463D96D for ; Tue, 25 Apr 2017 10:24:53 +0000 (UTC) Received: from secure.mitica (unknown [10.36.118.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B27762932; Tue, 25 Apr 2017 10:24:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D01463D96D Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=quintela@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D01463D96D From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 25 Apr 2017 12:24:41 +0200 Message-Id: <20170425102446.4008-2-quintela@redhat.com> In-Reply-To: <20170425102446.4008-1-quintela@redhat.com> References: <20170425102446.4008-1-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 25 Apr 2017 10:24:54 +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] [PATCH 1/6] monitor: Remove monitor parameter from save_vmstate 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" load_vmstate() already use error_report, so be consistent. There is an identical error message in load_vmstate() that ends in a period. Remove it. Signed-off-by: Juan Quintela Reviewed-by: Laurent Vivier --- include/sysemu/sysemu.h | 2 +- migration/savevm.c | 20 ++++++++++---------- replay/replay-snapshot.c | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 16175f7..b6daf9d 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -76,7 +76,7 @@ void qemu_add_machine_init_done_notifier(Notifier *notify= ); void qemu_remove_machine_init_done_notifier(Notifier *notify); =20 void hmp_savevm(Monitor *mon, const QDict *qdict); -int save_vmstate(Monitor *mon, const char *name); +int save_vmstate(const char *name); int load_vmstate(const char *name); void hmp_delvm(Monitor *mon, const QDict *qdict); void hmp_info_snapshots(Monitor *mon, const QDict *qdict); diff --git a/migration/savevm.c b/migration/savevm.c index 7421a67..ff934aa 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2070,7 +2070,7 @@ int qemu_loadvm_state(QEMUFile *f) return ret; } =20 -int save_vmstate(Monitor *mon, const char *name) +int save_vmstate(const char *name) { BlockDriverState *bs, *bs1; QEMUSnapshotInfo sn1, *sn =3D &sn1, old_sn1, *old_sn =3D &old_sn1; @@ -2084,8 +2084,8 @@ int save_vmstate(Monitor *mon, const char *name) AioContext *aio_context; =20 if (!bdrv_all_can_snapshot(&bs)) { - monitor_printf(mon, "Device '%s' is writable but does not " - "support snapshots.\n", bdrv_get_device_name(bs)); + error_report("Device '%s' is writable but does not support snapsho= ts", + bdrv_get_device_name(bs)); return ret; } =20 @@ -2102,7 +2102,7 @@ int save_vmstate(Monitor *mon, const char *name) =20 bs =3D bdrv_all_find_vmstate_bs(); if (bs =3D=3D NULL) { - monitor_printf(mon, "No block device can accept snapshots\n"); + error_report("No block device can accept snapshots"); return ret; } aio_context =3D bdrv_get_aio_context(bs); @@ -2111,7 +2111,7 @@ int save_vmstate(Monitor *mon, const char *name) =20 ret =3D global_state_store(); if (ret) { - monitor_printf(mon, "Error saving global state\n"); + error_report("Error saving global state"); return ret; } vm_stop(RUN_STATE_SAVE_VM); @@ -2143,7 +2143,7 @@ int save_vmstate(Monitor *mon, const char *name) /* save the VM state */ f =3D qemu_fopen_bdrv(bs, 1); if (!f) { - monitor_printf(mon, "Could not open VM state file\n"); + error_report("Could not open VM state file"); goto the_end; } ret =3D qemu_savevm_state(f, &local_err); @@ -2156,8 +2156,8 @@ int save_vmstate(Monitor *mon, const char *name) =20 ret =3D bdrv_all_create_snapshot(sn, bs, vm_state_size, &bs); if (ret < 0) { - monitor_printf(mon, "Error while creating snapshot on '%s'\n", - bdrv_get_device_name(bs)); + error_report("Error while creating snapshot on '%s'", + bdrv_get_device_name(bs)); goto the_end; } =20 @@ -2173,7 +2173,7 @@ int save_vmstate(Monitor *mon, const char *name) =20 void hmp_savevm(Monitor *mon, const QDict *qdict) { - save_vmstate(mon, qdict_get_try_str(qdict, "name")); + save_vmstate(qdict_get_try_str(qdict, "name")); } =20 void qmp_xen_save_devices_state(const char *filename, Error **errp) @@ -2245,7 +2245,7 @@ int load_vmstate(const char *name) MigrationIncomingState *mis =3D migration_incoming_get_current(); =20 if (!bdrv_all_can_snapshot(&bs)) { - error_report("Device '%s' is writable but does not support snapsho= ts.", + error_report("Device '%s' is writable but does not support snapsho= ts", bdrv_get_device_name(bs)); return -ENOTSUP; } diff --git a/replay/replay-snapshot.c b/replay/replay-snapshot.c index 65e2d37..8cced46 100644 --- a/replay/replay-snapshot.c +++ b/replay/replay-snapshot.c @@ -64,7 +64,7 @@ void replay_vmstate_init(void) { if (replay_snapshot) { if (replay_mode =3D=3D REPLAY_MODE_RECORD) { - if (save_vmstate(cur_mon, replay_snapshot) !=3D 0) { + if (save_vmstate(replay_snapshot) !=3D 0) { error_report("Could not create snapshot for icount record"= ); exit(1); } --=20 2.9.3