qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3] Improve error handling in do_snapshot_blkdev


From: Jes Sorensen
Subject: Re: [Qemu-devel] [PATCH v3] Improve error handling in do_snapshot_blkdev()
Date: Mon, 07 Mar 2011 17:39:39 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7

On 03/07/11 17:34, Anthony Liguori wrote:
> On 03/07/2011 09:27 AM, address@hidden wrote:
>>       if (ret != 0) {
>> -        abort();
>> +        qerror_report(QERR_OPEN_FILE_FAILED, filename);
>> +        error_printf("do_snapshot_blkdev(): Unable to open newly
>> created "
>> +                     "snapshot file: \n");
>> +        error_printf("%s. Attempting to revert to original image: %s\n",
>> +                     filename, old_filename);
> 
> You can't combine qerror_report with continued action.  qerror_report()
> should be a terminal action.  You also shouldn't combine error_printf()
> with qerror_report().
> 
> You should restore the original image file before doing qerror_report()
> and just drop the error_printf()s as it's all redundant information.

I would hardly consider it redundant information that it failed and we
try to go back to the original image. That is an error in itself, even
though rolling back is better than abort()ing.

If qerror_report() is a fatal situation, that is problematic. Then we
need qerror_warn() or something as well, which can return non fatal
information.

The printfs are very valuable for the human monitor, but it isn't really
clear to me what is the ideal return value.

Cheers,
Jes



reply via email to

[Prev in Thread] Current Thread [Next in Thread]