All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: qemu-devel@nongnu.org, dgilbert@redhat.com, peterx@redhat.com
Subject: Re: [Qemu-devel] [PATCH 6/6] migration: Pass Error ** argument to {save, load}_vmstate
Date: Tue, 25 Apr 2017 19:31:42 +0200	[thread overview]
Message-ID: <87efwgmm0x.fsf@secure.mitica> (raw)
In-Reply-To: <2881bd24-5dbe-3714-c4bc-582950ccc125@redhat.com> (Laurent Vivier's message of "Tue, 25 Apr 2017 19:10:20 +0200")

Laurent Vivier <lvivier@redhat.com> wrote:
> On 25/04/2017 19:00, Juan Quintela wrote:
>> Laurent Vivier <lvivier@redhat.com> wrote:
>>> On 25/04/2017 12:24, Juan Quintela wrote:

>>>>  {
>>>> +    Error *err = NULL;
>>>> +
>>>>      if (replay_snapshot) {
>>>>          if (replay_mode == REPLAY_MODE_RECORD) {
>>>> -            if (save_vmstate(replay_snapshot) != 0) {
>>>> +            if (save_vmstate(replay_snapshot, &err) != 0) {
>>>>                  error_report("Could not create snapshot for icount record");
>>>>                  exit(1);
>>>>              }
>>>>          } else if (replay_mode == REPLAY_MODE_PLAY) {
>>>> -            if (load_vmstate(replay_snapshot) != 0) {
>>>> +            if (load_vmstate(replay_snapshot, &err) != 0) {
>>>>                  error_report("Could not load snapshot for icount replay");
>>>>                  exit(1);
>>>>              }
>>>
>>> You can use "&error_fatal" in these cases.
>> 
>> I was very happy with your suggestion.  But then I realized that if I
>> use error_fatal, I would lost the error_report() messages, right?
>
> The "Could not create snapshot for icount record" and "Could not load
> snapshot for icount replay", yes.
>
> But you keep the one from the inside load_vmstate().

    if (!bdrv_all_can_snapshot(&bs)) {
        error_setg(errp, "Device '%s' is writable but does not support "
                   "snapshots", bdrv_get_device_name(bs));
        return ret;
    }

This is the 1st error on save_vmstate.  My understanding is that now I
get something like (two messages):

Device 'foo' is writable but does not support snapshots
Could not create snapshot for icount record

If I change to error_fatal, only the 1st message will appear.  And I am
not replay maintainer to decide the change O:-)


> Isn't it enough?

Dunno.

Later, Juan.

  reply	other threads:[~2017-04-25 17:31 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
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 [this message]
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=87efwgmm0x.fsf@secure.mitica \
    --to=quintela@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.