On 13 July 2017 at 13:32, Kevin Wolf <kw...@redhat.com> 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