qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/4] tests/qtest: Reorganize common code in ivshmem-test


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 2/4] tests/qtest: Reorganize common code in ivshmem-test
Date: Tue, 13 Feb 2024 16:56:52 +0100
User-agent: Mozilla Thunderbird

On 27/11/23 06:20, Gustavo Romero wrote:
This commit reorganizes the ivshmem-test qtest by moving common structs,
functions, and code that can be utilized by other ivshmem qtests into
two new files: ivshmem-utils.h and ivshmem-utils.c.

Enum Reg, struct ServerThread, and mktempshm() have been relocated to
these new files. Two new functions have been introduced to handle the
ivshmem server start/stop: test_ivshmem_server_{start,stop}.

To accommodate the new way for starting/stopping the ivshmem server,
struct ServerThread now includes two new members: 'server', previously
present but not a member of any struct; and 'status', a new member of a
new type, ServerStartStatus, used to track and handle service
termination properly.

Additionally, a new function, mktempsocket(), has been added to help
create a unix socket filename, similar to what mktempshm() does for the
creation of a shm file.

Finally, the ivshmem-test qtest has been adapted to use the new ivhsmem
utils. Adjustments in that sense have also been made to meson.build;
also 'rt' have been removed as a lib dependency for ivhsmem-test.c.

Two lines unrelated to these changes have had their line indentation
also fixed in meson.build.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
---
  tests/qtest/ivshmem-test.c  | 113 ++------------------------
  tests/qtest/ivshmem-utils.c | 155 ++++++++++++++++++++++++++++++++++++
  tests/qtest/ivshmem-utils.h |  56 +++++++++++++
  tests/qtest/meson.build     |   6 +-
  4 files changed, 221 insertions(+), 109 deletions(-)
  create mode 100644 tests/qtest/ivshmem-utils.c
  create mode 100644 tests/qtest/ivshmem-utils.h
LGTM!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]