aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlberto Faria <afaria@redhat.com>2022-07-05 17:15:09 +0100
committerHanna Reitz <hreitz@redhat.com>2022-07-12 12:14:56 +0200
commitbf5b16fa401633475d21d69c66532f5b29e8433d (patch)
tree60779d913b400906135b6bbce90d6128a52ac3ef /tests
parent92529251d2333ea07176cdbd7273483064ba5a7b (diff)
downloadqemu-bf5b16fa401633475d21d69c66532f5b29e8433d.zip
qemu-bf5b16fa401633475d21d69c66532f5b29e8433d.tar.gz
qemu-bf5b16fa401633475d21d69c66532f5b29e8433d.tar.bz2
block: Make blk_{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. Signed-off-by: Alberto Faria <afaria@redhat.com> Message-Id: <20220705161527.1054072-2-afaria@redhat.com> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test-block-iothread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/test-block-iothread.c b/tests/unit/test-block-iothread.c
index a5c163a..3c1a3f6 100644
--- a/tests/unit/test-block-iothread.c
+++ b/tests/unit/test-block-iothread.c
@@ -117,7 +117,7 @@ static void test_sync_op_blk_pread(BlockBackend *blk)
/* Success */
ret = blk_pread(blk, 0, buf, sizeof(buf));
- g_assert_cmpint(ret, ==, 512);
+ g_assert_cmpint(ret, ==, 0);
/* Early error: Negative offset */
ret = blk_pread(blk, -2, buf, sizeof(buf));
@@ -131,7 +131,7 @@ static void test_sync_op_blk_pwrite(BlockBackend *blk)
/* Success */
ret = blk_pwrite(blk, 0, buf, sizeof(buf), 0);
- g_assert_cmpint(ret, ==, 512);
+ g_assert_cmpint(ret, ==, 0);
/* Early error: Negative offset */
ret = blk_pwrite(blk, -2, buf, sizeof(buf), 0);