From nobody Mon Sep 16 19:08:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=riseup.net ARC-Seal: i=1; a=rsa-sha256; t=1693753616; cv=none; d=zohomail.com; s=zohoarc; b=NyQ7dFTTrAlLM23khoqMrcG8BsmFtQ5a8B2pJDzk5IeP8LT5sVS/txyf8o7ZJBVW/hC2Fq+zeaYstQ/3HwZc6Ir3vwGj5x/eeRBz6RSNyU5nw0SsvEDV3pyt+ujKRcZgXT7ar5uPxUMHnS2Lp03r8hv3usR/fW0TCBY2gz8cRu8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693753616; 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=xdvE/VImUKutPw50Ba+CIxHrl2lO0VjSyu1+IfLDdtM=; b=Zdp7+4w+IB090nRmZdYF0Qxg6KVSUv8hG1zLoFKUy6MyLTUZZtOpEIhpdF0mg9wqBQR4Sv8khIgN+zcCUPx50KAlxrgpIYqLM14uVFdDqX2Of3r/+1EBWxWoT8ehG7ejWouOEOpFPnWyFXXKktlHu9yo3neAhF5g07FmLq9L/0g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 16937536167491023.2594161809179; Sun, 3 Sep 2023 08:06:56 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-584-TyN21cm4PgCnhGdh0tEFTA-1; Sun, 03 Sep 2023 11:06:49 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 536803C025AD; Sun, 3 Sep 2023 15:06:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F77A493114; Sun, 3 Sep 2023 15:06:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 113FA1946588; Sun, 3 Sep 2023 15:06:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9EB1D1946586 for ; Sun, 3 Sep 2023 15:06:45 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9110721EE561; Sun, 3 Sep 2023 15:06:45 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8919221EE560 for ; Sun, 3 Sep 2023 15:06:45 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 63794800CA8 for ; Sun, 3 Sep 2023 15:06:45 +0000 (UTC) Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-450-xbc4bO37OCm4sxoBSXn39w-1; Sun, 03 Sep 2023 11:06:43 -0400 Received: from fews02-sea.riseup.net (fews02-sea-pn.riseup.net [10.0.1.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx1.riseup.net (Postfix) with ESMTPS id 4Rdw8d2tcpzDr9K for ; Sun, 3 Sep 2023 15:06:41 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4Rdw8c1kzFzFq1y; Sun, 3 Sep 2023 15:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693753615; 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=xdvE/VImUKutPw50Ba+CIxHrl2lO0VjSyu1+IfLDdtM=; b=dgBZUDulmisVarXVtDEGMpsY3RPHyS+LJYOT7d5AMkq3zOEnAqZvtYiY2fz9lQOsh+cWCV 6sRbKTdAN6N0apvqTSsvEatlRaygVNnwbRR+XsFbXZuZbAhmUs++UUUPGs1x3WwXgC43V3 M9RgMAp7G36DXULNkI5Mjorypi/RP68= X-MC-Unique: TyN21cm4PgCnhGdh0tEFTA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: xbc4bO37OCm4sxoBSXn39w-1 X-Riseup-User-ID: 867C80CF32C177F9586D16CFC2157C8B1133572246A65F1D30889A07901DBF7E From: K Shiva Kiran To: libvir-list@redhat.com Subject: [PATCH 5/8] Implement RPC Client for Network Metadata change callbacks Date: Sun, 3 Sep 2023 20:28:37 +0530 Message-ID: <20230903150541.200896-6-shiva_kr@riseup.net> In-Reply-To: <20230903150541.200896-1-shiva_kr@riseup.net> References: <20230903150541.200896-1-shiva_kr@riseup.net> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: K Shiva Kiran Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: riseup.net Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1693753617710100009 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: K Shiva Kiran --- src/remote/remote_driver.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index b81c9bc611..5d581dae48 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -378,6 +378,11 @@ remoteNetworkBuildEventLifecycle(virNetClientProgram *= prog G_GNUC_UNUSED, virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); =20 +static void +remoteNetworkBuildEventCallbackMetadataChange(virNetClientProgram *prog, + virNetClient *client, + void *evdata, void *opaque); + static void remoteStoragePoolBuildEventLifecycle(virNetClientProgram *prog G_GNUC_UNUS= ED, virNetClient *client G_GNUC_UNUSED, @@ -505,6 +510,10 @@ static virNetClientProgramEvent remoteEvents[] =3D { remoteNetworkBuildEventLifecycle, sizeof(remote_network_event_lifecycle_msg), (xdrproc_t)xdr_remote_network_event_lifecycle_msg }, + { REMOTE_PROC_NETWORK_EVENT_CALLBACK_METADATA_CHANGE, + remoteNetworkBuildEventCallbackMetadataChange, + sizeof(remote_network_event_callback_metadata_change_msg), + (xdrproc_t)xdr_remote_network_event_callback_metadata_change_msg }, { REMOTE_PROC_DOMAIN_EVENT_CALLBACK_LIFECYCLE, remoteDomainBuildEventCallbackLifecycle, sizeof(remote_domain_event_callback_lifecycle_msg), @@ -4944,6 +4953,28 @@ remoteNetworkBuildEventLifecycle(virNetClientProgram= *prog G_GNUC_UNUSED, virObjectEventStateQueueRemote(priv->eventState, event, msg->callbackI= D); } =20 +static void +remoteNetworkBuildEventCallbackMetadataChange(virNetClientProgram *prog G_= GNUC_UNUSED, + virNetClient *client G_GNUC_= UNUSED, + void *evdata, void *opaque) +{ + virConnectPtr conn =3D opaque; + remote_network_event_callback_metadata_change_msg *msg =3D evdata; + struct private_data *priv =3D conn->privateData; + virNetworkPtr net; + virObjectEvent *event =3D NULL; + + if (!(net =3D get_nonnull_network(conn, msg->net))) + return; + + event =3D virNetworkEventMetadataChangeNewFromNet(net, msg->type, msg-= >nsuri ? *msg->nsuri : NULL); + + virObjectUnref(net); + + virObjectEventStateQueueRemote(priv->eventState, event, msg->callbackI= D); +} + + static void remoteStoragePoolBuildEventLifecycle(virNetClientProgram *prog G_GNUC_UNUS= ED, virNetClient *client G_GNUC_UNUSED, --=20 2.42.0