aboutsummaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorAlberto Faria <afaria@redhat.com>2022-06-09 16:27:36 +0100
committerHanna Reitz <hreitz@redhat.com>2022-07-12 12:14:55 +0200
commit32cc71def9e3885f9527af713e6d8dc7521ddc08 (patch)
tree9ec7c6a1c10523d79b9b8aeb4ba6ace82c3f5b87 /tests/unit
parent53fb7844f03241a0e6de2c342c9e1b89df12da4d (diff)
block: Change bdrv_{pread,pwrite,pwrite_sync}() param order
Swap 'buf' and 'bytes' around for consistency with bdrv_co_{pread,pwrite}(), and in preparation to implement these functions using generated_co_wrapper. Callers were updated using this Coccinelle script: @@ expression child, offset, buf, bytes, flags; @@ - bdrv_pread(child, offset, buf, bytes, flags) + bdrv_pread(child, offset, bytes, buf, flags) @@ expression child, offset, buf, bytes, flags; @@ - bdrv_pwrite(child, offset, buf, bytes, flags) + bdrv_pwrite(child, offset, bytes, buf, flags) @@ expression child, offset, buf, bytes, flags; @@ - bdrv_pwrite_sync(child, offset, buf, bytes, flags) + bdrv_pwrite_sync(child, offset, bytes, buf, flags) Resulting overly-long lines were then fixed by hand. Signed-off-by: Alberto Faria <afaria@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Message-Id: <20220609152744.3891847-3-afaria@redhat.com> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/test-block-iothread.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit/test-block-iothread.c b/tests/unit/test-block-iothread.c
index 4db1ad5dfe..49fb1ef1ea 100644
--- a/tests/unit/test-block-iothread.c
+++ b/tests/unit/test-block-iothread.c
@@ -88,11 +88,11 @@ static void test_sync_op_pread(BdrvChild *c)
int ret;
/* Success */
- ret = bdrv_pread(c, 0, buf, sizeof(buf), 0);
+ ret = bdrv_pread(c, 0, sizeof(buf), buf, 0);
g_assert_cmpint(ret, ==, 512);
/* Early error: Negative offset */
- ret = bdrv_pread(c, -2, buf, sizeof(buf), 0);
+ ret = bdrv_pread(c, -2, sizeof(buf), buf, 0);
g_assert_cmpint(ret, ==, -EIO);
}
@@ -102,11 +102,11 @@ static void test_sync_op_pwrite(BdrvChild *c)
int ret;
/* Success */
- ret = bdrv_pwrite(c, 0, buf, sizeof(buf), 0);
+ ret = bdrv_pwrite(c, 0, sizeof(buf), buf, 0);
g_assert_cmpint(ret, ==, 512);
/* Early error: Negative offset */
- ret = bdrv_pwrite(c, -2, buf, sizeof(buf), 0);
+ ret = bdrv_pwrite(c, -2, sizeof(buf), buf, 0);
g_assert_cmpint(ret, ==, -EIO);
}