diff options
author | Christian Schoenebeck <qemu_oss@crudebyte.com> | 2022-10-04 22:53:49 +0200 |
---|---|---|
committer | Christian Schoenebeck <qemu_oss@crudebyte.com> | 2022-10-24 12:24:32 +0200 |
commit | a9a53769318503c4d8884e642e00603ea6885cb1 (patch) | |
tree | 47eec9380152a4e680d8c558be8f4df163a4891b | |
parent | 1ebacc40ca925626cf601543326066434c7c1a7f (diff) |
tests/9p: simplify callers of treaddir()
Now as treaddir() is using a declarative approach, simplify the
code of callers of this function.
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-Id: <7cec6f2c7011a481806c34908893b7282702a7a6.1664917004.git.qemu_oss@crudebyte.com>
-rw-r--r-- | tests/qtest/virtio-9p-test.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index e5c174c218..99e24fce0b 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -120,12 +120,12 @@ static void fs_readdir(void *obj, void *data, QGuestAllocator *t_alloc) /* * submit count = msize - 11, because 11 is the header size of Rreaddir */ - req = treaddir({ + treaddir({ .client = v9p, .fid = 1, .offset = 0, .count = P9_MAX_SIZE - 11, - .requestOnly = true - }).req; - v9fs_req_wait_for_reply(req, NULL); - v9fs_rreaddir(req, &count, &nentries, &entries); + .rreaddir = { + .count = &count, .nentries = &nentries, .entries = &entries + } + }); /* * Assuming msize (P9_MAX_SIZE) is large enough so we can retrieve all @@ -190,12 +190,13 @@ static void do_readdir_split(QVirtio9P *v9p, uint32_t count) npartialentries = 0; partialentries = NULL; - req = treaddir({ + treaddir({ .client = v9p, .fid = fid, .offset = offset, .count = count, - .requestOnly = true - }).req; - v9fs_req_wait_for_reply(req, NULL); - v9fs_rreaddir(req, &count, &npartialentries, &partialentries); + .rreaddir = { + .count = &count, .nentries = &npartialentries, + .entries = &partialentries + } + }); if (npartialentries > 0 && partialentries) { if (!entries) { entries = partialentries; |