[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/42] tests/qtest: assert qmp connected
From: |
Fabiano Rosas |
Subject: |
[PULL 23/42] tests/qtest: assert qmp connected |
Date: |
Wed, 29 Jan 2025 13:00:40 -0300 |
From: Steve Sistare <steven.sistare@oracle.com>
Assert that qmp_fd is valid when we communicate with the monitor.
Suggested-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Link:
1736967650-129648-23-git-send-email-steven.sistare@oracle.com">https://lore.kernel.org/r/1736967650-129648-23-git-send-email-steven.sistare@oracle.com
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
tests/qtest/libqtest.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index fbb51e3e55..437b24fa2e 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -811,6 +811,7 @@ QDict *qtest_qmp_receive(QTestState *s)
QDict *qtest_qmp_receive_dict(QTestState *s)
{
+ g_assert(s->qmp_fd >= 0);
return qmp_fd_receive(s->qmp_fd);
}
@@ -838,12 +839,14 @@ int qtest_socket_server(const char *socket_path)
void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num,
const char *fmt, va_list ap)
{
+ g_assert(s->qmp_fd >= 0);
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)
{
+ g_assert(s->qmp_fd >= 0);
qmp_fd_vsend(s->qmp_fd, fmt, ap);
}
@@ -904,6 +907,7 @@ void qtest_qmp_send_raw(QTestState *s, const char *fmt, ...)
{
va_list ap;
+ g_assert(s->qmp_fd >= 0);
va_start(ap, fmt);
qmp_fd_vsend_raw(s->qmp_fd, fmt, ap);
va_end(ap);
--
2.35.3
- [PULL 00/42] Migration patches for 2025-01-29, Fabiano Rosas, 2025/01/29
- [PULL 04/42] physmem: qemu_ram_alloc_from_fd extensions, Fabiano Rosas, 2025/01/29
- [PULL 05/42] physmem: fd-based shared memory, Fabiano Rosas, 2025/01/29
- [PULL 07/42] machine: aux-ram-share option, Fabiano Rosas, 2025/01/29
- [PULL 10/42] hostmem-memfd: preserve for cpr, Fabiano Rosas, 2025/01/29
- [PULL 02/42] backends/hostmem-shm: factor out allocation of "anonymous shared memory with an fd", Fabiano Rosas, 2025/01/29
- [PULL 12/42] migration: enhance migrate_uri_parse, Fabiano Rosas, 2025/01/29
- [PULL 15/42] migration: VMSTATE_FD, Fabiano Rosas, 2025/01/29
- [PULL 20/42] tests/qtest: defer connection, Fabiano Rosas, 2025/01/29
- [PULL 22/42] tests/qtest: enhance migration channels, Fabiano Rosas, 2025/01/29
- [PULL 23/42] tests/qtest: assert qmp connected,
Fabiano Rosas <=
- [PULL 26/42] migration: Remove postcopy implications in should_send_vmdesc(), Fabiano Rosas, 2025/01/29
- [PULL 30/42] migration: Drop inactivate_disk param in qemu_savevm_state_complete*, Fabiano Rosas, 2025/01/29
- [PULL 33/42] migration: Adjust locking in migration_maybe_pause(), Fabiano Rosas, 2025/01/29
- [PULL 03/42] physmem: fix qemu_ram_alloc_from_fd size calculation, Fabiano Rosas, 2025/01/29
- [PULL 06/42] memory: add RAM_PRIVATE, Fabiano Rosas, 2025/01/29
- [PULL 11/42] hostmem-shm: preserve for cpr, Fabiano Rosas, 2025/01/29
- [PULL 21/42] migration-test: defer connection, Fabiano Rosas, 2025/01/29
- [PULL 14/42] migration: SCM_RIGHTS for QEMUFile, Fabiano Rosas, 2025/01/29
- [PULL 28/42] migration: Optimize postcopy on downtime by avoiding JSON writer, Fabiano Rosas, 2025/01/29
- [PULL 29/42] migration: Avoid two src-downtime-end tracepoints for postcopy, Fabiano Rosas, 2025/01/29