Re: [PATCH 3/7] block: Make bdrv_{pread, pwrite}() return 0 on success

2022-05-13 Thread Alberto Faria
On Fri, May 13, 2022 at 9:22 AM Paolo Bonzini wrote: > The callers only check the return code of vhdx_log_peek_hdr, > vhdx_log_read_sectors, vhdx_log_write_sectors with ret < 0. But looking > at the callers: > > - vhdx_log_read_desc propagates ret directly from a successful >

Re: [PATCH 3/7] block: Make bdrv_{pread, pwrite}() return 0 on success

2022-05-13 Thread Paolo Bonzini
On 5/13/22 01:38, Alberto Faria wrote: @@ -113,7 +113,7 @@ static ssize_t qcow2_crypto_hdr_read_func(QCryptoBlock *block, size_t offset, error_setg_errno(errp, -ret, "Could not read encryption header"); return -1; } -return ret; +return buflen; } @@ -174,7

[PATCH 3/7] block: Make bdrv_{pread,pwrite}() return 0 on success

2022-05-12 Thread Alberto Faria
They currently return the value of their 'bytes' parameter on success. Make them return 0 instead, for consistency with other I/O functions and in preparation to implement them using generated_co_wrapper. This also makes it clear that short reads/writes are not possible. The few callers that