tests/9p: split virtio-9p-test.c into tests and 9p client part
PATCH v2 1/1 tests/9p: split virtio-9p-test.c into tests and 9p client part
This patch is pure refactoring, it does not change behaviour.
virtio-9p-test.c grew to 1657 lines. Let's split this file up between actual 9p test cases vs. 9p test client, to make it easier to concentrate on the actual 9p tests.
Move the 9p test client code to a new unit virtio-9p-client.c, which are basically all functions and types prefixed with v9fs_* already.
Note that some client wrapper functions (do_*) are preserved in virtio-9p-test.c, simply because these wrapper functions are going to be wiped with subsequent patches anyway.
As the global QGuestAllocator variable is moved to virtio-9p-client.c, add a new function v9fs_set_allocator() to be used by virtio-9p-test.c instead of fiddling with a global variable across units and libraries.
---
v1 -> v2:
- Move osdep.h include from virtio-9p-client.h to virtio-9p-client.c.
tests/qtest/libqos/meson.build | 1 + tests/qtest/libqos/virtio-9p-client.c | 684 +++++++++++++++++++++++ tests/qtest/libqos/virtio-9p-client.h | 138 +++++ tests/qtest/virtio-9p-test.c | 770 +------------------------- 4 files changed, 849 insertions(+), 744 deletions(-) create mode 100644 tests/qtest/libqos/virtio-9p-client.c create mode 100644 tests/qtest/libqos/virtio-9p-client.h
tests/qtest/libqos/meson.build +1 -0
@@ -34,6 +34,7 @@ libqos_srcs = files( 'tpci200.c', 'virtio.c', 'virtio-9p.c', + 'virtio-9p-client.c', 'virtio-balloon.c', 'virtio-blk.c', 'vhost-user-blk.c',
tests/qtest/libqos/virtio-9p-client.c new file +684 -0
684 lines not on this page · raw message
tests/qtest/libqos/virtio-9p-client.h new file +138 -0
138 lines not on this page · raw message
tests/qtest/virtio-9p-test.c +26 -744
943 lines not on this page · raw message
Signature · 1 line
2.30.2
Quoted 13 lines · On Donnerstag, 29. September 2022 13:41:06 CEST Christian Schoenebeck wrote:
This patch is pure refactoring, it does not change behaviour.
virtio-9p-test.cgrew to 1657 lines. Let's split this file up between actual 9p test cases vs. 9p test client, to make it easier to concentrate on the actual 9p tests.Move the 9p test client code to a new unit
virtio-9p-client.c, which are basically all functions and types prefixed with v9fs_* already.Note that some client wrapper functions (do_*) are preserved in
virtio-9p-test.c, simply because these wrapper functions are going to be wiped with subsequent patches anyway.
Quoted 7 lines
As the global QGuestAllocator variable is moved to
virtio-9p-client.c, add a new functionv9fs_set_allocator()to be used byvirtio-9p-test.cinstead of fiddling with a global variable across units and libraries.Signed-off-by Christian Schoenebeck <[email protected]>Reviewed-by Greg Kurz <[email protected]>---
Queued on 9p.next:
https://github.com/cschoenebeck/qemu/commits/9p.next
Thanks!
Best regards,
Christian Schoenebeck
Quoted 11 lines
v1 -> v2:
- Moveosdep.hinclude fromvirtio-9p-client.htovirtio-9p-client.c.tests/qtest/libqos/meson.build | 1 + tests/qtest/libqos/virtio-9p-client.c | 684 +++++++++++++++++++++++ tests/qtest/libqos/virtio-9p-client.h | 138 +++++ tests/qtest/virtio-9p-test.c | 770 +------------------------- 4 files changed, 849 insertions(+), 744 deletions(-) create mode 100644 tests/qtest/libqos/virtio-9p-client.c create mode 100644 tests/qtest/libqos/virtio-9p-client.h