From nobody Sun Feb 8 19:59:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1572629807; cv=none; d=zoho.com; s=zohoarc; b=OrylFqEjpbPgFDhIzZVNME/D/nVZn7hndKGOHh3wOSoeByz82d7VrDtsqUZlyu1nbg8sPqj0SQc3ZPxMHEtr8F/8c4xoDCMJp33oK9eKdtcS5HuEtBq28qzzABocIVO6/FlYljjMmlTi+A5DntTE8JrQ866/AH7woielizlID0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572629807; h=Content-Type:Content-Transfer-Encoding:Cc: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=ECvnMu86lF19HrlShFWdv3R5sKjjH9ijaFe7pAzgPjg=; b=Y3ZF2zQzBC7QBGYQG3A+HZ06uzZBz2eVa4+vT6tiXegvBSaU/3B8GQwuRWmXKwukLC9vYa2U9ubNmqHtJwooJBCGGl4Gj9r7ScL0WfCWtJYIKYMt22/LOdZD/bfzRCd1ml4KN+Elnx92mo39EltDOCKEuJnTf2QWo91Dz+TI4Rg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1572629807137136.82973192484553; Fri, 1 Nov 2019 10:36:47 -0700 (PDT) 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-55-I1CkKP8ZOsmT-QoL7wE6TQ-1; Fri, 01 Nov 2019 13:36:44 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EE48D800A1E; Fri, 1 Nov 2019 17:36:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA0711001920; Fri, 1 Nov 2019 17:36:39 +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 573F018089CE; Fri, 1 Nov 2019 17:36:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xA1HaHJr028019 for ; Fri, 1 Nov 2019 13:36:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 329E260876; Fri, 1 Nov 2019 17:36:17 +0000 (UTC) Received: from mx1.redhat.com (ext-mx22.extmail.prod.ext.phx2.redhat.com [10.5.110.63]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D51960870 for ; Fri, 1 Nov 2019 17:36:14 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC8B018CB8E2 for ; Fri, 1 Nov 2019 17:36:13 +0000 (UTC) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id xA1Gqv0d018682 for ; Fri, 1 Nov 2019 13:36:13 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2w0pf46h19-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 01 Nov 2019 13:36:13 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 1 Nov 2019 17:36:11 -0000 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 1 Nov 2019 17:36:09 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xA1Ha8ax44433848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 1 Nov 2019 17:36:08 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 80B1442045; Fri, 1 Nov 2019 17:36:08 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5387D42041; Fri, 1 Nov 2019 17:36:08 +0000 (GMT) Received: from marcibm.ibmuc.com (unknown [9.145.5.215]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 1 Nov 2019 17:36:08 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572629806; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=ECvnMu86lF19HrlShFWdv3R5sKjjH9ijaFe7pAzgPjg=; b=Gd3440SyprV9tpEB+AgcRIlQQI497mK8ze26S17NRH9m1BuhdFNFfKRMC36p00IMA3NVCG PdQrcrm+r5P8g4MRsx4vFYjz7wywM8uONgNubF8c6gpFQjN4PuY7wqhaAVXMWeZATgl/kR +PKQultIGz3vF5xNBS0HBHx71Fod1iA= From: Marc Hartmayer To: Date: Fri, 1 Nov 2019 18:35:46 +0100 In-Reply-To: <20191101173548.7888-1-mhartmay@linux.ibm.com> References: <20191101173548.7888-1-mhartmay@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19110117-0016-0000-0000-000002BFE0CF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19110117-0017-0000-0000-000033214A7A Message-Id: <20191101173548.7888-5-mhartmay@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-11-01_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=802 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1911010158 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Fri, 01 Nov 2019 17:36:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Fri, 01 Nov 2019 17:36:14 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'mhartmay@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.7 (RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.63 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Peter Krempa , Pavel Hrdina Subject: [libvirt] [PATCH v3 4/6] remote: Use domainClientEventCallbacks for remoteReplayConnectionClosedEvent 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.84 on 10.5.11.22 X-MC-Unique: I1CkKP8ZOsmT-QoL7wE6TQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This allows us later to get rid of another usage of the global variable `remoteProgram`. Signed-off-by: Marc Hartmayer Reviewed-by: Pavel Hrdina --- src/remote/remote_daemon_dispatch.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index e7f6d4c9f138..70f1f7d815e8 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -1620,12 +1620,12 @@ remoteRelayDomainQemuMonitorEvent(virConnectPtr con= n, static void remoteRelayConnectionClosedEvent(virConnectPtr conn G_GNUC_UNUSED, in= t reason, void *opaque) { - virNetServerClientPtr client =3D opaque; + daemonClientEventCallbackPtr callback =3D opaque; =20 VIR_DEBUG("Relaying connection closed event, reason %d", reason); =20 remote_connect_event_connection_closed_msg msg =3D { reason }; - remoteDispatchObjectEventSend(client, remoteProgram, + remoteDispatchObjectEventSend(callback->client, callback->program, REMOTE_PROC_CONNECT_EVENT_CONNECTION_CLO= SED, (xdrproc_t)xdr_remote_connect_event_conn= ection_closed_msg, &msg); @@ -4176,6 +4176,7 @@ remoteDispatchConnectRegisterCloseCallback(virNetServ= erPtr server G_GNUC_UNUSED, virNetMessageErrorPtr rerr) { int rv =3D -1; + daemonClientEventCallbackPtr callback =3D NULL; struct daemonClientPrivate *priv =3D virNetServerClientGetPrivateData(client); virConnectPtr conn =3D remoteGetHypervisorConn(client); @@ -4185,9 +4186,17 @@ remoteDispatchConnectRegisterCloseCallback(virNetSer= verPtr server G_GNUC_UNUSED, if (!conn) goto cleanup; =20 + if (VIR_ALLOC(callback) < 0) + goto cleanup; + + callback->client =3D virObjectRef(client); + callback->program =3D virObjectRef(remoteProgram); + /* eventID, callbackID, and legacy are not used */ + callback->eventID =3D -1; + callback->callbackID =3D -1; if (virConnectRegisterCloseCallback(conn, remoteRelayConnectionClosedEvent, - client, NULL) < 0) + callback, remoteEventCallbackFree)= < 0) goto cleanup; =20 priv->closeRegistered =3D true; @@ -4195,8 +4204,10 @@ remoteDispatchConnectRegisterCloseCallback(virNetSer= verPtr server G_GNUC_UNUSED, =20 cleanup: virMutexUnlock(&priv->lock); - if (rv < 0) + if (rv < 0) { + remoteEventCallbackFree(callback); virNetMessageSaveError(rerr); + } return rv; } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list