[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V7 22/24] tests/qtest: assert qmp connected
From: |
Steve Sistare |
Subject: |
[PATCH V7 22/24] tests/qtest: assert qmp connected |
Date: |
Wed, 15 Jan 2025 11:00:48 -0800 |
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>
---
tests/qtest/libqtest.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index b1e0df9..812b7e8 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -788,6 +788,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);
}
@@ -815,12 +816,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);
}
@@ -881,6 +884,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);
--
1.8.3.1
- [PATCH V7 09/24] hostmem-memfd: preserve for cpr, (continued)
- [PATCH V7 09/24] hostmem-memfd: preserve for cpr, Steve Sistare, 2025/01/15
- [PATCH V7 06/24] machine: aux-ram-share option, Steve Sistare, 2025/01/15
- [PATCH V7 11/24] migration: enhance migrate_uri_parse, Steve Sistare, 2025/01/15
- [PATCH V7 12/24] migration: incoming channel, Steve Sistare, 2025/01/15
- [PATCH V7 14/24] migration: VMSTATE_FD, Steve Sistare, 2025/01/15
- [PATCH V7 13/24] migration: SCM_RIGHTS for QEMUFile, Steve Sistare, 2025/01/15
- [PATCH V7 17/24] migration-test: memory_backend, Steve Sistare, 2025/01/15
- [PATCH V7 15/24] migration: cpr-transfer save and load, Steve Sistare, 2025/01/15
- [PATCH V7 10/24] hostmem-shm: preserve for cpr, Steve Sistare, 2025/01/15
- [PATCH V7 16/24] migration: cpr-transfer mode, Steve Sistare, 2025/01/15
- [PATCH V7 22/24] tests/qtest: assert qmp connected,
Steve Sistare <=
- [PATCH V7 21/24] tests/qtest: enhance migration channels, Steve Sistare, 2025/01/15
- [PATCH V7 24/24] migration: cpr-transfer documentation, Steve Sistare, 2025/01/15
- [PATCH V7 18/24] tests/qtest: optimize migrate_set_ports, Steve Sistare, 2025/01/15
- [PATCH V7 19/24] tests/qtest: defer connection, Steve Sistare, 2025/01/15
- [PATCH V7 20/24] migration-test: defer connection, Steve Sistare, 2025/01/15
- [PATCH V7 23/24] migration-test: cpr-transfer, Steve Sistare, 2025/01/15