[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH v2] Improve error handling in do_snapshot_bl
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] Re: [PATCH v2] Improve error handling in do_snapshot_blkdev() |
Date: |
Mon, 07 Mar 2011 16:31:08 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10 |
Am 07.03.2011 16:24, schrieb Jes Sorensen:
> On 03/07/11 11:01, Kevin Wolf wrote:
>> Am 03.03.2011 14:13, schrieb address@hidden:
>>> @@ -591,6 +592,12 @@ int do_snapshot_blkdev(Monitor *mon, const QDict
>>> *qdict, QObject **ret_data)
>>> goto out;
>>> }
>>>
>>> + strncpy(old_filename, bs->filename, sizeof(old_filename));
>>> + old_filename[1023] = '\0';
>>
>> qemu has pstrcpy() from cutils.c for this.
>
> I'll change it to use pstrcpy().
>
>>> - 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",
>>
>> That should probably be a colon in "%s: Attempting..." Also, is the
>> leading space intentional?
>
> The colon is already there prior to the \n" on the previous printf line.
> The space was intentional, but maybe that will just confuse people so I
> will remove it. I added a colon after image: in the last line instead.
Sorry, I failed to read the context. It's the end of a sentence started
in the line before, so having . instead of : after %s is correct, of course.
Kevin