qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: Juan Quintela <quintela@redhat.com>, qemu-devel@nongnu.org
Cc: dgilbert@redhat.com, peterx@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/6] monitor: Remove monitor parameter from save_vmstate
Date: Tue, 25 Apr 2017 15:27:01 +0200	[thread overview]
Message-ID: <187f04b5-a3a4-05f0-0ca9-6da60800bcf2@redhat.com> (raw)
In-Reply-To: <20170425102446.4008-2-quintela@redhat.com>

On 25/04/2017 12:24, Juan Quintela wrote:
> 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 <quintela@redhat.com>

Reviewed-by: Laurent Vivier <lvivier@redhat.com>

> ---
>  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);
>  
>  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;
>  }
>  
> -int save_vmstate(Monitor *mon, const char *name)
> +int save_vmstate(const char *name)
>  {
>      BlockDriverState *bs, *bs1;
>      QEMUSnapshotInfo sn1, *sn = &sn1, old_sn1, *old_sn = &old_sn1;
> @@ -2084,8 +2084,8 @@ int save_vmstate(Monitor *mon, const char *name)
>      AioContext *aio_context;
>  
>      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 snapshots",
> +                     bdrv_get_device_name(bs));
>          return ret;
>      }
>  
> @@ -2102,7 +2102,7 @@ int save_vmstate(Monitor *mon, const char *name)
>  
>      bs = bdrv_all_find_vmstate_bs();
>      if (bs == NULL) {
> -        monitor_printf(mon, "No block device can accept snapshots\n");
> +        error_report("No block device can accept snapshots");
>          return ret;
>      }
>      aio_context = bdrv_get_aio_context(bs);
> @@ -2111,7 +2111,7 @@ int save_vmstate(Monitor *mon, const char *name)
>  
>      ret = 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 = 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 = qemu_savevm_state(f, &local_err);
> @@ -2156,8 +2156,8 @@ int save_vmstate(Monitor *mon, const char *name)
>  
>      ret = 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;
>      }
>  
> @@ -2173,7 +2173,7 @@ int save_vmstate(Monitor *mon, const char *name)
>  
>  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"));
>  }
>  
>  void qmp_xen_save_devices_state(const char *filename, Error **errp)
> @@ -2245,7 +2245,7 @@ int load_vmstate(const char *name)
>      MigrationIncomingState *mis = migration_incoming_get_current();
>  
>      if (!bdrv_all_can_snapshot(&bs)) {
> -        error_report("Device '%s' is writable but does not support snapshots.",
> +        error_report("Device '%s' is writable but does not support snapshots",
>                       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 == REPLAY_MODE_RECORD) {
> -            if (save_vmstate(cur_mon, replay_snapshot) != 0) {
> +            if (save_vmstate(replay_snapshot) != 0) {
>                  error_report("Could not create snapshot for icount record");
>                  exit(1);
>              }
> 

  reply	other threads:[~2017-04-25 13:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-25 10:24 [Qemu-devel] [PATCH 0/6] Move snapshots commands to hmp Juan Quintela
2017-04-25 10:24 ` [Qemu-devel] [PATCH 1/6] monitor: Remove monitor parameter from save_vmstate Juan Quintela
2017-04-25 13:27   ` Laurent Vivier [this message]
2017-04-25 10:24 ` [Qemu-devel] [PATCH 2/6] monitor: Move hmp_loadvm from monitor.c to hmp.c Juan Quintela
2017-04-25 13:37   ` Laurent Vivier
2017-04-25 10:24 ` [Qemu-devel] [PATCH 3/6] monitor: Move hmp_savevm from savevm.c " Juan Quintela
2017-04-25 13:33   ` Laurent Vivier
2017-04-25 10:24 ` [Qemu-devel] [PATCH 4/6] monitor: Move hmp_delvm " Juan Quintela
2017-04-25 13:34   ` Laurent Vivier
2017-04-25 10:24 ` [Qemu-devel] [PATCH 5/6] monitor: Move hmp_info_snapshots " Juan Quintela
2017-04-25 14:15   ` Laurent Vivier
2017-04-25 16:48     ` Juan Quintela
2017-04-25 10:24 ` [Qemu-devel] [PATCH 6/6] migration: Pass Error ** argument to {save, load}_vmstate Juan Quintela
2017-04-25 15:21   ` Laurent Vivier
2017-04-25 17:00     ` Juan Quintela
2017-04-25 17:10       ` Laurent Vivier
2017-04-25 17:31         ` Juan Quintela
2017-04-28 14:47   ` Dr. David Alan Gilbert
2017-04-28 15:19     ` Markus Armbruster
2017-04-28 16:13       ` Dr. David Alan Gilbert
2017-04-28 15:20     ` Eric Blake
2017-04-28 15:07 ` [Qemu-devel] [PATCH 0/6] Move snapshots commands to hmp Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=187f04b5-a3a4-05f0-0ca9-6da60800bcf2@redhat.com \
    --to=lvivier@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).