From: Thomas Huth <thuth@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: "Bin Meng" <bin.meng@windriver.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PULL 21/37] tests/qtest: libqtest: Exclude the *_fds APIs for win32
Date: Wed, 28 Sep 2022 09:18:27 +0200 [thread overview]
Message-ID: <20220928071843.1468323-22-thuth@redhat.com> (raw)
In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com>
From: Bin Meng <bin.meng@windriver.com>
libqmp.c::qmp_fd_vsend_fds() is not available on Windows, hence any
APIs in libqtest that call libqmp.c::qmp_fd_vsend_fds() should be
excluded for win32 too. This includes the following:
* qtest_qmp_vsend_fds()
* qtest_vqmp_fds()
* qtest_qmp_fds()
* qtest_qmp_add_client()
Note qtest_qmp_vsend() was wrongly written to call qmp_fd_vsend_fds()
previously, but it should call the non fds version API qmp_fd_vsend().
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-35-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/libqtest.h | 8 ++++++++
tests/qtest/libqtest.c | 10 +++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h
index 94b187837d..3abc75964d 100644
--- a/tests/qtest/libqtest.h
+++ b/tests/qtest/libqtest.h
@@ -94,6 +94,7 @@ void qtest_kill_qemu(QTestState *s);
*/
void qtest_quit(QTestState *s);
+#ifndef _WIN32
/**
* qtest_qmp_fds:
* @s: #QTestState instance to operate on.
@@ -108,6 +109,7 @@ void qtest_quit(QTestState *s);
QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num,
const char *fmt, ...)
G_GNUC_PRINTF(4, 5);
+#endif /* _WIN32 */
/**
* qtest_qmp:
@@ -152,6 +154,7 @@ void qtest_qmp_send_raw(QTestState *s, const char *fmt, ...)
*/
int qtest_socket_server(const char *socket_path);
+#ifndef _WIN32
/**
* qtest_vqmp_fds:
* @s: #QTestState instance to operate on.
@@ -167,6 +170,7 @@ int qtest_socket_server(const char *socket_path);
QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num,
const char *fmt, va_list ap)
G_GNUC_PRINTF(4, 0);
+#endif /* _WIN32 */
/**
* qtest_vqmp:
@@ -181,6 +185,7 @@ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num,
QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
G_GNUC_PRINTF(2, 0);
+#ifndef _WIN32
/**
* qtest_qmp_vsend_fds:
* @s: #QTestState instance to operate on.
@@ -196,6 +201,7 @@ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num,
const char *fmt, va_list ap)
G_GNUC_PRINTF(4, 0);
+#endif /* _WIN32 */
/**
* qtest_qmp_vsend:
@@ -743,6 +749,7 @@ void qtest_qmp_device_add_qdict(QTestState *qts, const char *drv,
void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id,
const char *fmt, ...) G_GNUC_PRINTF(4, 5);
+#ifndef _WIN32
/**
* qtest_qmp_add_client:
* @qts: QTestState instance to operate on
@@ -752,6 +759,7 @@ void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id,
* Call QMP ``getfd`` followed by ``add_client`` with the given @fd.
*/
void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd);
+#endif /* _WIN32 */
/**
* qtest_qmp_device_del:
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index d8ffa0e7b1..5c4a509c58 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -592,17 +592,20 @@ int qtest_socket_server(const char *socket_path)
return sock;
}
+#ifndef _WIN32
void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num,
const char *fmt, va_list ap)
{
qmp_fd_vsend_fds(s->qmp_fd, fds, fds_num, fmt, ap);
}
+#endif
void qtest_qmp_vsend(QTestState *s, const char *fmt, va_list ap)
{
- qmp_fd_vsend_fds(s->qmp_fd, NULL, 0, fmt, ap);
+ qmp_fd_vsend(s->qmp_fd, fmt, ap);
}
+#ifndef _WIN32
QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num,
const char *fmt, va_list ap)
{
@@ -611,6 +614,7 @@ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num,
/* Receive reply */
return qtest_qmp_receive(s);
}
+#endif
QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
{
@@ -620,6 +624,7 @@ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
return qtest_qmp_receive(s);
}
+#ifndef _WIN32
QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num,
const char *fmt, ...)
{
@@ -631,6 +636,7 @@ QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num,
va_end(ap);
return response;
}
+#endif
QDict *qtest_qmp(QTestState *s, const char *fmt, ...)
{
@@ -1327,6 +1333,7 @@ void qtest_qmp_device_add(QTestState *qts, const char *driver, const char *id,
qobject_unref(args);
}
+#ifndef _WIN32
void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd)
{
QDict *resp;
@@ -1346,6 +1353,7 @@ void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd)
g_assert(!qdict_haskey(resp, "error"));
qobject_unref(resp);
}
+#endif
/*
* Generic hot-unplugging test via the device_del QMP command.
--
2.31.1
next prev parent reply other threads:[~2022-09-28 8:17 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-28 7:18 [PULL 00/37] qtests fixes Thomas Huth
2022-09-28 7:18 ` [PULL 01/37] tests/qtest: i440fx-test: Rewrite create_blob_file() to be portable Thomas Huth
2022-09-28 7:18 ` [PULL 02/37] tests/qtest: ahci-test: Avoid using hardcoded /tmp Thomas Huth
2022-09-28 7:18 ` [PULL 03/37] tests/qtest: aspeed_smc-test: " Thomas Huth
2022-09-28 7:18 ` [PULL 04/37] tests/qtest: boot-serial-test: " Thomas Huth
2022-09-28 7:18 ` [PULL 05/37] tests/qtest: cxl-test: " Thomas Huth
2022-09-28 7:18 ` [PULL 06/37] tests/qtest: fdc-test: " Thomas Huth
2022-09-28 7:18 ` [PULL 07/37] tests/qtest: generic_fuzz: " Thomas Huth
2022-09-28 7:18 ` [PULL 08/37] tests/qtest: virtio_blk_fuzz: " Thomas Huth
2022-09-28 7:18 ` [PULL 09/37] tests/qtest: ide-test: " Thomas Huth
2022-09-28 7:18 ` [PULL 10/37] tests/qtest: vhost-user-blk-test: " Thomas Huth
2022-09-28 7:18 ` [PULL 11/37] tests/qtest: virtio-blk-test: " Thomas Huth
2022-09-28 7:18 ` [PULL 12/37] tests/qtest: virtio-scsi-test: " Thomas Huth
2022-09-28 7:18 ` [PULL 13/37] tests/qtest: libqtest: " Thomas Huth
2022-09-28 7:18 ` [PULL 14/37] tests/unit: test-image-locking: " Thomas Huth
2022-09-28 7:18 ` [PULL 15/37] tests/unit: test-qga: " Thomas Huth
2022-09-28 7:18 ` [PULL 16/37] tests: vhost-user-bridge: " Thomas Huth
2022-09-28 7:18 ` [PULL 17/37] tests/qtest: Skip running virtio-net-test cases that require socketpair() for win32 Thomas Huth
2022-09-28 7:18 ` [PULL 18/37] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only Thomas Huth
2022-09-28 7:18 ` [PULL 19/37] tests/qtest: qmp-test: Skip running test_qmp_oob for win32 Thomas Huth
2022-09-28 7:18 ` [PULL 20/37] tests/qtest: libqtest: Adapt global_qtest declaration " Thomas Huth
2022-09-28 7:18 ` Thomas Huth [this message]
2022-09-28 7:18 ` [PULL 22/37] tests/qtest: {ahci, ide}-test: Use relative path for temporary files " Thomas Huth
2022-09-28 7:18 ` [PULL 23/37] tests/qtest: bios-tables-test: Adapt the case " Thomas Huth
2022-09-28 7:18 ` [PULL 24/37] tests/qtest: migration-test: Disable IO redirection " Thomas Huth
2022-09-28 7:18 ` [PULL 25/37] tests/qtest: ide-test: Open file in binary mode Thomas Huth
2022-09-28 7:18 ` [PULL 26/37] tests/qtest: virtio-net-failover: Disable migration tests for win32 Thomas Huth
2022-09-28 7:18 ` [PULL 27/37] tests/qtest: microbit-test: Fix socket access " Thomas Huth
2022-09-28 7:18 ` [PULL 28/37] tests/qtest: libqtest: Replace the call to close a socket with closesocket() Thomas Huth
2022-09-28 7:18 ` [PULL 29/37] tests/qtest: migration-test: Skip running some TLS cases for win32 Thomas Huth
2022-09-28 7:18 ` [PULL 30/37] .gitlab-ci.d/windows.yml: Display meson test logs Thomas Huth
2022-09-28 7:18 ` [PULL 31/37] tests/x86: Move common code to function in device-plug-test Thomas Huth
2022-09-28 7:18 ` [PULL 32/37] tests/qtest: hd-geo-test: Avoid using hardcoded /tmp Thomas Huth
2022-09-28 7:18 ` [PULL 33/37] tests/qtest: pflash-cfi02-test: " Thomas Huth
2022-09-28 7:18 ` [PULL 34/37] tests/qtest: qmp-test: " Thomas Huth
2022-09-28 7:18 ` [PULL 35/37] tests/qtest: vhost-user-test: " Thomas Huth
2022-09-28 7:18 ` [PULL 36/37] tests/qtest: boot-serial-test: Close the serial file before starting QEMU Thomas Huth
2022-09-28 7:18 ` [PULL 37/37] docs/devel: testing: Document writing portable test cases Thomas Huth
2022-09-29 14:49 ` [PULL 00/37] qtests fixes Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220928071843.1468323-22-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=bin.meng@windriver.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).