[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/33] qtest: add qtest_pid()
From: |
marcandre . lureau |
Subject: |
[PULL 18/33] qtest: add qtest_pid() |
Date: |
Tue, 27 Jun 2023 15:02:15 +0200 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Used in the following test on win32, to share sockets with the QEMU
process.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230606115658.677673-7-marcandre.lureau@redhat.com>
---
tests/qtest/libqtest.h | 9 +++++++++
tests/qtest/libqtest.c | 5 +++++
2 files changed, 14 insertions(+)
diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h
index a12acf7fa9..913acc3d5c 100644
--- a/tests/qtest/libqtest.h
+++ b/tests/qtest/libqtest.h
@@ -985,4 +985,13 @@ void qtest_qom_set_bool(QTestState *s, const char *path,
const char *property,
* Returns: Value retrieved from property.
*/
bool qtest_qom_get_bool(QTestState *s, const char *path, const char *property);
+
+/**
+ * qtest_pid:
+ * @s: QTestState instance to operate on.
+ *
+ * Returns: the PID of the QEMU process, or <= 0
+ */
+pid_t qtest_pid(QTestState *s);
+
#endif
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index de03ef5f60..79152f0ec3 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -142,6 +142,11 @@ static int socket_accept(int sock)
return ret;
}
+pid_t qtest_pid(QTestState *s)
+{
+ return s->qemu_pid;
+}
+
bool qtest_probe_child(QTestState *s)
{
pid_t pid = s->qemu_pid;
--
2.41.0
- [PULL 05/33] chardev/char-win-stdio: Support VT sequences on Windows 11 host, (continued)
- [PULL 05/33] chardev/char-win-stdio: Support VT sequences on Windows 11 host, marcandre . lureau, 2023/06/27
- [PULL 04/33] virtio-gpu: Optimize 2D resource data transfer, marcandre . lureau, 2023/06/27
- [PULL 03/33] ui/sdl2: OpenGL window context, marcandre . lureau, 2023/06/27
- [PULL 07/33] ui/dbus: Expose a touch device interface, marcandre . lureau, 2023/06/27
- [PULL 01/33] ui: return NULL when getting cursor without a console, marcandre . lureau, 2023/06/27
- [PULL 15/33] ui/dbus: compile without gio/gunixfdlist.h, marcandre . lureau, 2023/06/27
- [PULL 12/33] ui/gtk: making dmabuf NULL when it's released., marcandre . lureau, 2023/06/27
- [PULL 09/33] virtio-gpu-udmabuf: create udmabuf for blob even when iov_cnt == 1, marcandre . lureau, 2023/06/27
- [PULL 18/33] qtest: add qtest_pid(),
marcandre . lureau <=
- [PULL 16/33] scripts: add a XML preprocessor script, marcandre . lureau, 2023/06/27
- [PULL 14/33] ui/egl: fix make_context_current() callback return value, marcandre . lureau, 2023/06/27
- [PULL 13/33] ui/egl: export qemu_egl_get_error_string(), marcandre . lureau, 2023/06/27
- [PULL 19/33] tests: make dbus-display-test work on win32, marcandre . lureau, 2023/06/27
- [PULL 23/33] ui/dbus: use shared memory when possible on win32, marcandre . lureau, 2023/06/27
- [PULL 24/33] ui: add egl-headless support on win32, marcandre . lureau, 2023/06/27
- [PULL 22/33] virtio-gpu/win32: allocate shareable 2d resources/images, marcandre . lureau, 2023/06/27
- [PULL 11/33] virtio-gpu: OUT_OF_MEMORY if failing to create udmabuf, marcandre . lureau, 2023/06/27
- [PULL 10/33] ui/gtk: set the area of the scanout texture correctly, marcandre . lureau, 2023/06/27