block: Make bdrv_{pread,pwrite}() return 0 on success
commit353a5d84b25c335b259f37c4f43dad96e6d60ba8
authorAlberto Faria <afaria@redhat.com>
Thu, 9 Jun 2022 15:27:37 +0000 (9 16:27 +0100)
committerHanna Reitz <hreitz@redhat.com>
Tue, 12 Jul 2022 10:14:55 +0000 (12 12:14 +0200)
tree2bad4cabb0ec9703ee289439ca877b00b5f07696
parent32cc71def9e3885f9527af713e6d8dc7521ddc08
block: Make bdrv_{pread,pwrite}() return 0 on success

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 rely on the previous behavior are adjusted
accordingly by hand.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220609152744.3891847-4-afaria@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
block/cloop.c
block/crypto.c
block/dmg.c
block/io.c
block/qcow.c
block/qcow2.c
block/qed.c
block/vdi.c
block/vmdk.c
tests/unit/test-block-iothread.c