qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] block/vpc.c: Handle write failures in get_image


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] block/vpc.c: Handle write failures in get_image_offset()
Date: Thu, 13 Jul 2017 13:36:40 +0100

On 13 July 2017 at 13:32, Kevin Wolf <address@hidden> wrote:
> Am 09.07.2017 um 23:07 hat Peter Maydell geschrieben:
>> Coverity (CID 1355236) points out that get_image_offset() doesn't check that
>> it actually succeeded in writing the updated block bitmap to the file.
>> Check the error return from bdrv_pwrite_sync() and propagate an error
>> response back up to the function which calls get_image_offset() for
>> a write so that it can return the error to its caller.
>>
>> get_sector_offset() is only used for reads, but we move it to the
>> same API for consistency.

> get_sector_offset() has two useless parameters now instead of one, but
> I'll just send a patch on top to remove them.

I thought about doing that, but I decided it was better to
keep it as it is. A get_sector_offset() that silently only
works for reads and causes disk corruption if you use it for
a write seemed like a bit of a bear trap to leave lying around.

thanks
-- PMM



reply via email to

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