[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/6] migration: Pass Error ** argument to {save,
From: |
Juan Quintela |
Subject: |
Re: [Qemu-devel] [PATCH 6/6] migration: Pass Error ** argument to {save, load}_vmstate |
Date: |
Tue, 25 Apr 2017 19:31:42 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Laurent Vivier <address@hidden> wrote:
> On 25/04/2017 19:00, Juan Quintela wrote:
>> Laurent Vivier <address@hidden> 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.
Re: [Qemu-devel] [PATCH 0/6] Move snapshots commands to hmp, Dr. David Alan Gilbert, 2017/04/28