From nobody Sun Feb 8 20:28:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583412742; cv=none; d=zohomail.com; s=zohoarc; b=YSC7WZwAPMu0YqfxGRNoa8J1dmyj43huvHPUfcRvqFTbtDeKn8O6mx/eSrCoJgxh8Sc7v8m7yHOJldOk6yyBmYVMouecYNUlEwdyWwXeeBEKdSDhpsCpAchBtSWQULXusag2BJm1s2FeUsUrqHRfh9UZa8BXMV+TjVYuXk7pQHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583412742; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=f12r/DS/D0/0ZjDspvC7quT5A/lnSRUp/cicNdryrKA=; b=F8uvk/KWnNYNTqzorkqoys9YsU9gSgTb3kAXL760t9IR8OsAfKgBWKCN01w6YlPyP3HmdjOe6/yHWIWCjUtFA2aKT1kQh8HnMnVsDm+AK5GaVFiAxPsUndmeJhgO6lBd9MoCntt0uClbuiFZoNky6ANs7Q4hEYJfnRVsfYG6wfs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1583412742265583.8316186632264; Thu, 5 Mar 2020 04:52:22 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-456-lmniKaoMPQahYJ0Nv0xCiQ-1; Thu, 05 Mar 2020 07:52:18 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 46516107B271; Thu, 5 Mar 2020 12:52:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 189995C219; Thu, 5 Mar 2020 12:52:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BBA1186A06; Thu, 5 Mar 2020 12:52:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 025CpuXn000885 for ; Thu, 5 Mar 2020 07:51:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id F2AB61001DF0; Thu, 5 Mar 2020 12:51:55 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60F951001DC2; Thu, 5 Mar 2020 12:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583412741; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=f12r/DS/D0/0ZjDspvC7quT5A/lnSRUp/cicNdryrKA=; b=hMigojIM29IhcFR5ak18TFtL/E9wKc92BrxHcKxXRfBQ3mqj6isnsuQDcvtWS6z7U2P2Sc NBIpvjO/WomCYKWSfidu4dUtTGRJH5QCKEzjZgBtXMgGndjoD8IfGlMghqfEfLLa8sXKdL 6ZO30v7e6vUneI1GJH+Wr+v+xK7vxjw= X-MC-Unique: lmniKaoMPQahYJ0Nv0xCiQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v2 4/7] tests: start/stop an event thread for QEMU monitor/agent tests Date: Thu, 5 Mar 2020 12:51:44 +0000 Message-Id: <20200305125147.2003011-5-berrange@redhat.com> In-Reply-To: <20200305125147.2003011-1-berrange@redhat.com> References: <20200305125147.2003011-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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=C3=A9 --- tests/qemumonitortestutils.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 00f5b49439..a30851aa63 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -36,6 +36,7 @@ #include "virlog.h" #include "virerror.h" #include "virstring.h" +#include "vireventthread.h" =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 @@ -66,6 +67,8 @@ struct _qemuMonitorTest { virNetSocketPtr server; virNetSocketPtr client; =20 + virEventThread *eventThread; + qemuMonitorPtr mon; qemuAgentPtr agent; =20 @@ -389,6 +392,8 @@ qemuMonitorTestFree(qemuMonitorTestPtr test) qemuAgentClose(test->agent); } =20 + g_object_unref(test->eventThread); + virObjectUnref(test->vm); =20 if (test->started) @@ -1138,6 +1143,7 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test) "}" /* We skip the normal handshake reply of "{\"execute\":\"qmp_capabilities\= "}" */ =20 + qemuMonitorTestPtr qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt, virDomainObjPtr vm, @@ -1153,6 +1159,9 @@ qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt, if (!(test =3D qemuMonitorCommonTestNew(xmlopt, vm, &src))) goto error; =20 + if (!(test->eventThread =3D virEventThreadNew("mon-test"))) + goto error; + test->qapischema =3D schema; if (!(test->mon =3D qemuMonitorOpen(test->vm, &src, @@ -1391,6 +1400,9 @@ qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt) if (!(test =3D qemuMonitorCommonTestNew(xmlopt, NULL, &src))) goto error; =20 + if (!(test->eventThread =3D virEventThreadNew("agent-test"))) + goto error; + if (!(test->agent =3D qemuAgentOpen(test->vm, &src, &qemuMonitorTestAgentCallbacks))) --=20 2.24.1