[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/20] tests/9p: simplify callers of twrite()
From: |
Christian Schoenebeck |
Subject: |
[PATCH 13/20] tests/9p: simplify callers of twrite() |
Date: |
Tue, 4 Oct 2022 22:54:00 +0200 |
Now as twrite() is using a declarative approach, simplify the
code of callers of this function.
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
tests/qtest/virtio-9p-test.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c
index a5b9284acb..5ad7bebec7 100644
--- a/tests/qtest/virtio-9p-test.c
+++ b/tests/qtest/virtio-9p-test.c
@@ -377,7 +377,6 @@ static void fs_write(void *obj, void *data, QGuestAllocator
*t_alloc)
char *wnames[] = { g_strdup(QTEST_V9FS_SYNTH_WRITE_FILE) };
g_autofree char *buf = g_malloc0(write_count);
uint32_t count;
- P9Req *req;
tattach({ .client = v9p });
twalk({
@@ -386,12 +385,10 @@ static void fs_write(void *obj, void *data,
QGuestAllocator *t_alloc)
tlopen({ .client = v9p, .fid = 1, .flags = O_WRONLY });
- req = twrite({
+ count = twrite({
.client = v9p, .fid = 1, .offset = 0, .count = write_count,
- .data = buf, .requestOnly = true
- }).req;
- v9fs_req_wait_for_reply(req, NULL);
- v9fs_rwrite(req, &count);
+ .data = buf
+ }).count;
g_assert_cmpint(count, ==, write_count);
g_free(wnames[0]);
--
2.30.2
- [PATCH 04/20] tests/9p: merge v9fs_tattach(), do_attach(), do_attach_rqid(), (continued)
- [PATCH 04/20] tests/9p: merge v9fs_tattach(), do_attach(), do_attach_rqid(), Christian Schoenebeck, 2022/10/04
- [PATCH 06/20] tests/9p: convert v9fs_tgetattr() to declarative arguments, Christian Schoenebeck, 2022/10/04
- [PATCH 05/20] tests/9p: simplify callers of tattach(), Christian Schoenebeck, 2022/10/04
- [PATCH 03/20] tests/9p: merge v9fs_tversion() and do_version(), Christian Schoenebeck, 2022/10/04
- [PATCH 09/20] tests/9p: simplify callers of treaddir(), Christian Schoenebeck, 2022/10/04
- [PATCH 10/20] tests/9p: convert v9fs_tlopen() to declarative arguments, Christian Schoenebeck, 2022/10/04
- [PATCH 08/20] tests/9p: convert v9fs_treaddir() to declarative arguments, Christian Schoenebeck, 2022/10/04
- [PATCH 07/20] tests/9p: simplify callers of tgetattr(), Christian Schoenebeck, 2022/10/04
- [PATCH 11/20] tests/9p: simplify callers of tlopen(), Christian Schoenebeck, 2022/10/04
- [PATCH 12/20] tests/9p: convert v9fs_twrite() to declarative arguments, Christian Schoenebeck, 2022/10/04
- [PATCH 13/20] tests/9p: simplify callers of twrite(),
Christian Schoenebeck <=
- [PATCH 14/20] tests/9p: convert v9fs_tflush() to declarative arguments, Christian Schoenebeck, 2022/10/04
- [PATCH 15/20] tests/9p: merge v9fs_tmkdir() and do_mkdir(), Christian Schoenebeck, 2022/10/04
- [PATCH 16/20] tests/9p: merge v9fs_tlcreate() and do_lcreate(), Christian Schoenebeck, 2022/10/04
- [PATCH 17/20] tests/9p: merge v9fs_tsymlink() and do_symlink(), Christian Schoenebeck, 2022/10/04
- [PATCH 18/20] tests/9p: merge v9fs_tlink() and do_hardlink(), Christian Schoenebeck, 2022/10/04
- [PATCH 19/20] tests/9p: merge v9fs_tunlinkat() and do_unlinkat(), Christian Schoenebeck, 2022/10/04
- [PATCH 20/20] tests/9p: remove unnecessary g_strdup() calls, Christian Schoenebeck, 2022/10/04
- Re: [PATCH 00/20] tests/9p: introduce declarative function calls, Christian Schoenebeck, 2022/10/12