tests/qtest: Use send/recv for socket communication
authorXuzhou Cheng <xuzhou.cheng@windriver.com>
Fri, 28 Oct 2022 04:57:27 +0000 (12:57 +0800)
committerThomas Huth <thuth@redhat.com>
Fri, 28 Oct 2022 09:17:12 +0000 (11:17 +0200)
commit84c662d2546feda2aeac21d09d4c71e8658062c0
treefdb02c7c94bafe2d15a1ce305b1a85d243cc8dd5
parentc9923550b446e54413024117c0ed978a08e3ab1a
tests/qtest: Use send/recv for socket communication

Socket communication in the libqtest and libqmp codes uses read()
and write() which work on any file descriptor on *nix, and sockets
in *nix are an example of a file descriptor.

However sockets on Windows do not use *nix-style file descriptors,
so read() and write() cannot be used on sockets on Windows.
Switch over to use send() and recv() instead which work on both
Windows and *nix.

Signed-off-by: Xuzhou Cheng <xuzhou.cheng@windriver.com>
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20221028045736.679903-3-bin.meng@windriver.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
include/qemu/sockets.h
tests/qtest/libqmp.c
tests/qtest/libqtest.c
util/osdep.c