On 17.10.2016 19:19, Vladimir Sementsov-Ogievskiy wrote: > On 07.10.2016 22:24, Max Reitz wrote: >> On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: >>> Realize block bitmap stroing interface, to allow qcow2 images store >>> persistent bitmaps. >>> >>> Signed-off-by: Vladimir Sementsov-Ogievskiy >>> --- >>> block/qcow2-bitmap.c | 241 >>> +++++++++++++++++++++++++++++++++++++++++++++++++++ > > [...] > >>> >>> + ret = bdrv_pwrite(bs->file, off, buf, cl_size); >>> + if (ret < 0) { >>> + goto finish; >>> + } >>> + >>> + if (end >= bm_size) { >>> + break; >>> + } >>> + >>> + bdrv_set_dirty_iter(dbi, end); >>> + } >>> + ret = 0; /* writes */ >> What is that comment supposed to mean? >> >> > > Now I think I can drop this assignment, as bdrv_aligned_preadv have > 'return ret < 0 ? ret : 0;' in the end... Am I right? Can bdrv_pwrite > and friends return positive value on success? I think so, but if they do return positive value they're supposed to be equal to the number of bytes written. In practice, though, any non-negative return value is treated the same (as success). I was just wondering about the comment, though, not about the assignment itself. Max