On 10/21/2016 02:44 PM, Max Reitz wrote: >> 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).
At one point in my conversion to byte access, I ran into test failures when trying to return number of bytes written; so commit 1a62d0a hard-codes a return of 0 on success instead. It will be a long and painful audit to find which callers expect which semantics, which I did not want to do. > > I was just wondering about the comment, though, not about the assignment > itself. > > Max > -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature