[libvirt PATCH 08/11] tests: start/stop an event thread for QEMU monitor/agent tests

Ján Tomko jtomko at redhat.com
Fri Feb 14 13:04:48 UTC 2020


On Fri, Feb 14, 2020 at 12:52:06PM +0000, Daniel P. Berrangé wrote:
>Tests which are using the QEMU monitor / agent need to have an
>event thread running a private GMainContext.
>
>There is already a thread running the main libvirt event loop
>but this can't be eliminated yet as it is used for more than
>just the monitor client I/O.
>
>Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
>---
> tests/qemumonitortestutils.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
>diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
>index b29e5d8cd2..a1641050ea 100644
>--- a/tests/qemumonitortestutils.c
>+++ b/tests/qemumonitortestutils.c
>@@ -1389,12 +1398,16 @@ qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt)
> {
>     qemuMonitorTestPtr test = NULL;
>     virDomainChrSourceDef src;
>+    g_autofree char *threadName = NULL;
>

../../tests/qemumonitortestutils.c:1402:22: error: unused variable 'threadName' [-Werror,-Wunused-variable]
     g_autofree char *threadName = NULL;
                      ^
1 error generated.

Jano

>     memset(&src, 0, sizeof(src));
>
>     if (!(test = qemuMonitorCommonTestNew(xmlopt, NULL, &src)))
>         goto error;
>
>+    if (!(test->eventThread = virEventThreadNew("agent-test")))
>+        goto error;
>+
>     if (!(test->agent = qemuAgentOpen(test->vm,
>                                       &src,
>                                       &qemuMonitorTestAgentCallbacks)))
>-- 
>2.24.1
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200214/f8fa576c/attachment-0001.sig>


More information about the libvir-list mailing list