From nobody Fri May 10 10:54:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1693753612; cv=none; d=zohomail.com; s=zohoarc; b=hPEZ77Baser5xu3D6aSWacYP42fQwMUluoEook+49OEm1pHodts5hc5zfJzfHYtjzzSl6tzOh685IbkoloN0UphGIBHnJuHSj3UeYzQuQszr4a0CgGP1PQ2P7SpRUvXU4cULyQdmvwKXOafFHVSdgQ9rvL0ZyYJkeB3LTsXyCTc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693753612; 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=XcDegzLuFqpcOycM3Du1UwV/z+W732ULOlEPYow1VI0=; b=mMWns5nK++7yNRBlkH+16SHNRyZG7meSDcc3/23kpvVefaYXCln79BDPLcDcT+XnqBLTl3BFheT8/KKyCkuV+NEFINyGnKNAWuhbWLJWDDZx5iQ/7uqExEIG0/vfnIfxbqA5ADvW6fU3j2fF6ONwah2XCSgt0zv3eYByW45SRSw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1693753612644682.5163374477922; Sun, 3 Sep 2023 08:06:52 -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-209-QeYFpJuvMQmvhzKH78IMag-1; Sun, 03 Sep 2023 11:06:41 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D72C61C068D6; Sun, 3 Sep 2023 15:06:39 +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 BFE2EC02996; Sun, 3 Sep 2023 15:06:39 +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 5FB4F1946588; Sun, 3 Sep 2023 15:06:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0164C1946586 for ; Sun, 3 Sep 2023 15:06:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D321AC8E4F1; Sun, 3 Sep 2023 15:06:37 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC4EEC02996 for ; Sun, 3 Sep 2023 15:06:37 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (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 B0FC88015AA for ; Sun, 3 Sep 2023 15:06:37 +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-130-AVy3uzVbObKN_8SdgpoPOg-1; Sun, 03 Sep 2023 11:06:35 -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 4Rdw8V6QByzDr89 for ; Sun, 3 Sep 2023 15:06:34 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4Rdw8T4sSkzFs32; Sun, 3 Sep 2023 15:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693753611; 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=XcDegzLuFqpcOycM3Du1UwV/z+W732ULOlEPYow1VI0=; b=ZrifqtDXcIb0fTTLOpEbOZtSBtkN75U0uy69PpmJZss+JAhCs/hRURz6rrz/cQ1aoRVGsj QHZABQxicmTsTUgdjbV6VR9kqbrB5fb+zZn24boBNOkjZjMUyd2NCxL5D6f2JFtMK2KAIy IZEMpz3w4efXZhx+MU9psdXem1hGLvI= X-MC-Unique: QeYFpJuvMQmvhzKH78IMag-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: AVy3uzVbObKN_8SdgpoPOg-1 X-Riseup-User-ID: B7F2078633998B5DFEEB5D4E7BEED0AC3604889B816727C7D588A7492244EA00 From: K Shiva Kiran To: libvir-list@redhat.com Subject: [PATCH 1/8] Define Network Metadata change callback function Date: Sun, 3 Sep 2023 20:28:33 +0530 Message-ID: <20230903150541.200896-2-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.8 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.8 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: 1693753613802100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: K Shiva Kiran Reviewed-by: Michal Privoznik --- include/libvirt/libvirt-network.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/libvirt/libvirt-network.h b/include/libvirt/libvirt-ne= twork.h index 0f7ad8300f..4b121ae0e7 100644 --- a/include/libvirt/libvirt-network.h +++ b/include/libvirt/libvirt-network.h @@ -576,4 +576,25 @@ virNetworkGetMetadata(virNetworkPtr network, const char *uri, unsigned int flags); =20 +/** + * virConnectNetworkEventMetadataChangeCallback: + * @conn: connection object + * @net: network on which the event occurred + * @type: a value from virNetworkMetadataType + * @nsuri: XML namespace URI + * @opaque: application specified data + * + * This callback is triggered when the Network XML metadata changes + * + * The callback signature to use when registering for an event of type + * VIR_NETWORK_EVENT_ID_METADATA_CHANGE with virConnectNetworkEventRegiste= rAny(). + * + * Since: 9.8.0 + */ +typedef void (*virConnectNetworkEventMetadataChangeCallback)(virConnectPtr= conn, + virNetworkPtr= net, + int type, + const char *n= suri, + void *opaque); + #endif /* LIBVIRT_NETWORK_H */ --=20 2.42.0 From nobody Fri May 10 10:54:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1693753610; cv=none; d=zohomail.com; s=zohoarc; b=a8OLgCOSwGLyx/2kaX8EBcNUen9Rcj4TrHZGEn1Z59z79k2HYpg7jkjjLa02HqRgeIf2LJ2KJe+7g6oXDOzjVBzpzzbzE3yIqiEj41QTl8zvb5zDroHQJgVPHWrfbG8kQjrhP8k5g5XNGA/pw//mwZJ5PiZRsrMruY3LKBukKds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693753610; 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=Loo843uQ8/x0d0cQOiHz/A1ZH29UNo7eTUGUsv3eXpc=; b=gS4JbTL8opOWYiNuLRO0EVn443sfKOROsDCQBfTYe9vVuYE0ZYVmSkcohfVnI810xZy3ANcqcthKYgbGBzSpPw48wLOWw755m4qz7AIq9bH8pKl8W3tmjACLdG8O9x88e+f5OlLHizyuuqxIkuYZDf+ulnn2grCWvfUX6Y0odQ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 169375361042651.27619438110435; Sun, 3 Sep 2023 08:06:50 -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-215--oKR8icsMgKzBGnt4vKyLw-1; Sun, 03 Sep 2023 11:06:43 -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 EE0F93C0E216; Sun, 3 Sep 2023 15:06:40 +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 D95E6525727; Sun, 3 Sep 2023 15:06:40 +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 9591A1946588; Sun, 3 Sep 2023 15:06:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B6D5619472A0 for ; Sun, 3 Sep 2023 15:06:39 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A71421460FFB; Sun, 3 Sep 2023 15:06:39 +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 9FD481460FFA for ; Sun, 3 Sep 2023 15:06:39 +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 84C4485651F for ; Sun, 3 Sep 2023 15:06:39 +0000 (UTC) Received: from mx0.riseup.net (mx0.riseup.net [198.252.153.6]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-2-Ly44QdJLOKCN3RsY5JF9DQ-1; Sun, 03 Sep 2023 11:06:37 -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 mx0.riseup.net (Postfix) with ESMTPS id 4Rdw8X3nvRz9tJt for ; Sun, 3 Sep 2023 15:06:36 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4Rdw8W2bcNzFs32; Sun, 3 Sep 2023 15:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693753608; 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=Loo843uQ8/x0d0cQOiHz/A1ZH29UNo7eTUGUsv3eXpc=; b=f25QuLQrqtGgYmejERqX1VmKezmgzX7JcRa8sGR53JiZWQYO6FKOtdGkbdTcwsysmIQ7TV nqFTejrzv3Jly1YcbiNwZ6yYH9FyIvodeoPCG53PCKRaI2pHZNLRbJJLP8gIWNO88IraHn 0/cTJnh8HikAmspLgwnD6ECaRovLhZk= X-MC-Unique: -oKR8icsMgKzBGnt4vKyLw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: Ly44QdJLOKCN3RsY5JF9DQ-1 X-Riseup-User-ID: A25F91ADACC78F1916C2BFF5BB9D7893FDBA75CB9826C5DE9B072D035B64F69E From: K Shiva Kiran To: libvir-list@redhat.com Subject: [PATCH 2/8] Define Network event struct for Metadata change Date: Sun, 3 Sep 2023 20:28:34 +0530 Message-ID: <20230903150541.200896-3-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.7 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: 1693753611544100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Adds: - New struct virNetworkEventMetadataChange. - virNetworkEvent*Dispose() function for the same. Signed-off-by: K Shiva Kiran Reviewed-by: Michal Privoznik --- src/conf/network_event.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/conf/network_event.c b/src/conf/network_event.c index 6f25e43711..51fa092ffd 100644 --- a/src/conf/network_event.c +++ b/src/conf/network_event.c @@ -45,10 +45,21 @@ struct _virNetworkEventLifecycle { }; typedef struct _virNetworkEventLifecycle virNetworkEventLifecycle; =20 +struct _virNetworkEventMetadataChange { + virNetworkEvent parent; + + int type; + char *nsuri; +}; +typedef struct _virNetworkEventMetadataChange virNetworkEventMetadataChang= e; + static virClass *virNetworkEventClass; static virClass *virNetworkEventLifecycleClass; +static virClass *virNetworkEventMetadataChangeClass; + static void virNetworkEventDispose(void *obj); static void virNetworkEventLifecycleDispose(void *obj); +static void virNetworkEventMetadataChangeDispose(void *obj); =20 static int virNetworkEventsOnceInit(void) @@ -59,6 +70,9 @@ virNetworkEventsOnceInit(void) if (!VIR_CLASS_NEW(virNetworkEventLifecycle, virNetworkEventClass)) return -1; =20 + if (!VIR_CLASS_NEW(virNetworkEventMetadataChange, virNetworkEventClass= )) + return -1; + return 0; } =20 @@ -231,3 +245,13 @@ virNetworkEventLifecycleNew(const char *name, =20 return (virObjectEvent *)event; } + + +static void +virNetworkEventMetadataChangeDispose(void *obj) +{ + virNetworkEventMetadataChange *event =3D obj; + VIR_DEBUG("obj=3D%p", event); + + g_free(event->nsuri); +} --=20 2.42.0 From nobody Fri May 10 10:54:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1693753611; cv=none; d=zohomail.com; s=zohoarc; b=FrN5dYVaQl0JEzNWIbvuB+Ael1eupkF4T0y/Eb+gsdx8hZt6zkFmOBRZnFmLzy0unKjaswx/ovuiOnCCf4mMPNOb+uyD+L9f/finjsK7N70tkNJT98vcvNtHCPV/gttYhBkrBZxjNOPfb59opeEpEILkEVqargxcAz+nluvX9Oc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693753611; 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=9nlPKJ1AvkbZ5aeXXsgfvFFZjkGVwjp7k0L4JM5s5q8=; b=NvjX/9EzuXOnS2SPm8atVBDbdL4OojkSJ5VLLQ0No7ueQckkx08lvYHoOfEgjmOvrLUSZqQ0fdhKCHYDRKpfj1WlNz1kyYT+FG7zS28BI+TN6H9PcUCqqbeC1SIb1bboFp73Oeni83isKygHkisXnvzKGcUvMOF6jzGVjHPbxn8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 16937536118291009.0777679763212; Sun, 3 Sep 2023 08:06:51 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-189-f0Mb-xGjP_GUkYg8KAwQNg-1; Sun, 03 Sep 2023 11:06:46 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 276DC805BFB; Sun, 3 Sep 2023 15:06:43 +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 10DD4200A86A; Sun, 3 Sep 2023 15:06:43 +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 CCE7F1946588; Sun, 3 Sep 2023 15:06:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 414261946586 for ; Sun, 3 Sep 2023 15:06:42 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 27CBA493112; Sun, 3 Sep 2023 15:06:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2059A493110 for ; Sun, 3 Sep 2023 15:06:42 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-inbound-delivery-1.mimecast.com [207.211.31.81]) (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 E5CAD3806714 for ; Sun, 3 Sep 2023 15:06:41 +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-259-8jaBeLsPPV2XZDfRcH-MUg-1; Sun, 03 Sep 2023 11:06:39 -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 4Rdw8Z1FyyzDr89 for ; Sun, 3 Sep 2023 15:06:38 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4Rdw8X74zfzFq1y; Sun, 3 Sep 2023 15:06:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693753610; 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=9nlPKJ1AvkbZ5aeXXsgfvFFZjkGVwjp7k0L4JM5s5q8=; b=ADzmUf56rdFnVmG+nwbrYGmmLCo0dvZCslYYj6M2HuDsMrLN8SPxXtDYccIEquZ9hwoWkK y65yaIZWqHko0TWTjL7DljorTdbGTCdxiVSpCSTY0C2E/7Iv2n232tTYTu6SzpvYHCZaxQ WHMS/UwHcgdskb6Oj7F4qVYyIyqnlNM= X-MC-Unique: f0Mb-xGjP_GUkYg8KAwQNg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 8jaBeLsPPV2XZDfRcH-MUg-1 X-Riseup-User-ID: 2B43F9B51FEB0A952A8726AD2A276786E240FB2D10654902C19B4136BA479A69 From: K Shiva Kiran To: libvir-list@redhat.com Subject: [PATCH 3/8] Add Event ID, Server side dispatcher and virsh print function Date: Sun, 3 Sep 2023 20:28:35 +0530 Message-ID: <20230903150541.200896-4-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.9 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.6 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: 1693753614075100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Adds the following for Network Metadata change callback events: - New Event ID VIR_NETWORK_EVENT_ID_METADATA_CHANGE - Server side dispatcher virsh: - New event type `metadata-change` - vshEventMetadataChangePrint() to display the above defined event type in virsh via `net-event` Signed-off-by: K Shiva Kiran Reviewed-by: Michal Privoznik --- I was unable to split this patch due to static assertions (perfomed against VIR_NETWORK_EVENT_ID_LAST) in remote_daemon_dispatch.c and virsh-network.c Please let me know if there is a way to split patches in such cases. include/libvirt/libvirt-network.h | 1 + src/conf/network_event.c | 12 ++++++++ src/remote/remote_daemon_dispatch.c | 38 ++++++++++++++++++++++++ src/remote/remote_protocol.x | 15 +++++++++- src/remote_protocol-structs | 6 ++++ tools/virsh-network.c | 46 ++++++++++++++++++++++++++++- 6 files changed, 116 insertions(+), 2 deletions(-) diff --git a/include/libvirt/libvirt-network.h b/include/libvirt/libvirt-ne= twork.h index 4b121ae0e7..58591be7ac 100644 --- a/include/libvirt/libvirt-network.h +++ b/include/libvirt/libvirt-network.h @@ -330,6 +330,7 @@ typedef void (*virConnectNetworkEventLifecycleCallback)= (virConnectPtr conn, */ typedef enum { VIR_NETWORK_EVENT_ID_LIFECYCLE =3D 0, /* virConnectNetworkEventL= ifecycleCallback (Since: 1.2.1) */ + VIR_NETWORK_EVENT_ID_METADATA_CHANGE =3D 1, /* virConnectNetworkEven= tMetadataChangeCallback (Since: 9.8.0) */ =20 # ifdef VIR_ENUM_SENTINELS VIR_NETWORK_EVENT_ID_LAST diff --git a/src/conf/network_event.c b/src/conf/network_event.c index 51fa092ffd..d1b3aa5721 100644 --- a/src/conf/network_event.c +++ b/src/conf/network_event.c @@ -118,6 +118,18 @@ virNetworkEventDispatchDefaultFunc(virConnectPtr conn, return; } =20 + case VIR_NETWORK_EVENT_ID_METADATA_CHANGE: + { + virNetworkEventMetadataChange *metadataChangeEvent; + + metadataChangeEvent =3D (virNetworkEventMetadataChange *)event; + ((virConnectNetworkEventMetadataChangeCallback)cb)(conn, net, + metadataCha= ngeEvent->type, + metadataCha= ngeEvent->nsuri, + cbopaque); + return; + } + case VIR_NETWORK_EVENT_ID_LAST: break; } diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index 2bb9e306a4..7daf503b51 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -1385,8 +1385,46 @@ remoteRelayNetworkEventLifecycle(virConnectPtr conn, return 0; } =20 +static int +remoteRelayNetworkEventMetadataChange(virConnectPtr conn, + virNetworkPtr net, + int type, + const char *nsuri, + void *opaque) +{ + daemonClientEventCallback *callback =3D opaque; + remote_network_event_callback_metadata_change_msg data; + + if (callback->callbackID < 0 || + !remoteRelayNetworkEventCheckACL(callback->client, conn, net)) + return -1; + + VIR_DEBUG("Relaying network metadata change %s %d %s, callback %d", + net->name, type, NULLSTR(nsuri), callback->callbackID); + + /* build return data */ + memset(&data, 0, sizeof(data)); + + data.type =3D type; + if (nsuri) { + data.nsuri =3D g_new0(remote_nonnull_string, 1); + *(data.nsuri) =3D g_strdup(nsuri); + } + + make_nonnull_network(&data.net, net); + data.callbackID =3D callback->callbackID; + + remoteDispatchObjectEventSend(callback->client, callback->program, + REMOTE_PROC_NETWORK_EVENT_CALLBACK_METAD= ATA_CHANGE, + (xdrproc_t)xdr_remote_network_event_call= back_metadata_change_msg, + &data); + return 0; +} + + static virConnectNetworkEventGenericCallback networkEventCallbacks[] =3D { VIR_NETWORK_EVENT_CALLBACK(remoteRelayNetworkEventLifecycle), + VIR_NETWORK_EVENT_CALLBACK(remoteRelayNetworkEventMetadataChange), }; =20 G_STATIC_ASSERT(G_N_ELEMENTS(networkEventCallbacks) =3D=3D VIR_NETWORK_EVE= NT_ID_LAST); diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 7ff059e393..e295b0acc3 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -3323,6 +3323,13 @@ struct remote_network_event_lifecycle_msg { int detail; }; =20 +struct remote_network_event_callback_metadata_change_msg { + int callbackID; + remote_nonnull_network net; + int type; + remote_string nsuri; +}; + struct remote_network_set_metadata_args { remote_nonnull_network network; int type; @@ -7008,5 +7015,11 @@ enum remote_procedure { * @generate: both * @acl: network:read */ - REMOTE_PROC_NETWORK_GET_METADATA =3D 445 + REMOTE_PROC_NETWORK_GET_METADATA =3D 445, + + /** + * @generate: both + * @acl: none + */ + REMOTE_PROC_NETWORK_EVENT_CALLBACK_METADATA_CHANGE =3D 446 }; diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index c07e0af1e6..e6132bee71 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -2687,6 +2687,12 @@ struct remote_network_event_lifecycle_msg { int event; int detail; }; +struct remote_network_event_callback_metadata_change_msg { + int callbackID; + remote_nonnull_network net; + int type; + remote_string nsuri; +}; struct remote_network_set_metadata_args { remote_nonnull_network network; int type; diff --git a/tools/virsh-network.c b/tools/virsh-network.c index de5d60593a..8965d87c9c 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -1582,7 +1582,8 @@ typedef struct virshNetEventData virshNetEventData; VIR_ENUM_DECL(virshNetworkEventId); VIR_ENUM_IMPL(virshNetworkEventId, VIR_NETWORK_EVENT_ID_LAST, - "lifecycle"); + "lifecycle", + "metadata-change"); =20 static void vshEventLifecyclePrint(virConnectPtr conn G_GNUC_UNUSED, @@ -1615,9 +1616,52 @@ vshEventLifecyclePrint(virConnectPtr conn G_GNUC_UNU= SED, vshEventDone(data->ctl); } =20 +VIR_ENUM_DECL(virshNetworkEventMetadataChangeType); +VIR_ENUM_IMPL(virshNetworkEventMetadataChangeType, + VIR_NETWORK_METADATA_LAST, + N_("description"), + N_("title"), + N_("element")); + +#define UNKNOWNSTR(str) (str ? str : N_("unsupported value")) + +static void +vshEventMetadataChangePrint(virConnectPtr conn G_GNUC_UNUSED, + virNetworkPtr net, + int type, + const char *nsuri, + void *opaque) +{ + virshNetEventData *data =3D opaque; + + if (!data->loop && data->count) + return; + + if (data->timestamp) { + char timestamp[VIR_TIME_STRING_BUFLEN]; + + if (virTimeStringNowRaw(timestamp) < 0) + timestamp[0] =3D '\0'; + + vshPrint(data->ctl, _("%1$s: event 'metadata-change' for network %= 2$s: type %3$s, uri %4$s\n"), + timestamp, virNetworkGetName(net), + UNKNOWNSTR(virshNetworkEventMetadataChangeTypeTypeToStrin= g(type)), NULLSTR(nsuri)); + } else { + vshPrint(data->ctl, _("event 'metadata-change' for network %1$s: t= ype %2$s, uri %3$s\n"), + virNetworkGetName(net), + UNKNOWNSTR(virshNetworkEventMetadataChangeTypeTypeToStrin= g(type)), NULLSTR(nsuri)); + } + + data->count++; + if (!data->loop) + vshEventDone(data->ctl); +} + virshNetworkEventCallback virshNetworkEventCallbacks[] =3D { { "lifecycle", VIR_NETWORK_EVENT_CALLBACK(vshEventLifecyclePrint), }, + { "metadata-change", + VIR_NETWORK_EVENT_CALLBACK(vshEventMetadataChangePrint), }, }; G_STATIC_ASSERT(VIR_NETWORK_EVENT_ID_LAST =3D=3D G_N_ELEMENTS(virshNetwork= EventCallbacks)); =20 --=20 2.42.0 From nobody Fri May 10 10:54:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=riseup.net Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 169375361503211.084003325790832; Sun, 3 Sep 2023 08:06:55 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-249-Dy6AmZT2OZywJTZy7pTq-w-1; Sun, 03 Sep 2023 11:06:47 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08B121817905; Sun, 3 Sep 2023 15:06:44 +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 E897A40ED77E; Sun, 3 Sep 2023 15:06:43 +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 CA5B91946588; Sun, 3 Sep 2023 15:06:43 +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 9C7E61946586 for ; Sun, 3 Sep 2023 15:06:42 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 900CF21EE561; Sun, 3 Sep 2023 15:06:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8867821EE560 for ; Sun, 3 Sep 2023 15:06:42 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 680733806714 for ; Sun, 3 Sep 2023 15:06:42 +0000 (UTC) Received: from mx0.riseup.net (mx0.riseup.net [198.252.153.6]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-279-qgbh2IrmPkqY2wUaYrwZeA-1; Sun, 03 Sep 2023 11:06:40 -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 mx0.riseup.net (Postfix) with ESMTPS id 4Rdw8b5FzFz9tGn for ; Sun, 3 Sep 2023 15:06:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4Rdw8Z4RqlzFq1y; Sun, 3 Sep 2023 15:06:38 +0000 (UTC) X-MC-Unique: Dy6AmZT2OZywJTZy7pTq-w-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: qgbh2IrmPkqY2wUaYrwZeA-1 X-Riseup-User-ID: E4497EACC47778003A93620AC1C41E19BCAF0DCCAC3AD43B4FB03CC490C04125 From: K Shiva Kiran To: libvir-list@redhat.com Subject: [PATCH 4/8] Add methods to create Metadata change events Date: Sun, 3 Sep 2023 20:28:36 +0530 Message-ID: <20230903150541.200896-5-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.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: riseup.net Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1693753615650100005 Content-Type: text/plain; charset="utf-8"; x-default="true" Adds two new private methods to create metadata change events: - virNetworkEventMetadataChangeNewFromNet() - virNetworkEventMetadataChangeNewFromObj() Signed-off-by: K Shiva Kiran Reviewed-by: Michal Privoznik --- src/conf/network_event.c | 48 ++++++++++++++++++++++++++++++++++++++++ src/conf/network_event.h | 11 +++++++++ src/libvirt_private.syms | 2 ++ 3 files changed, 61 insertions(+) diff --git a/src/conf/network_event.c b/src/conf/network_event.c index d1b3aa5721..5eb9c3d48f 100644 --- a/src/conf/network_event.c +++ b/src/conf/network_event.c @@ -267,3 +267,51 @@ virNetworkEventMetadataChangeDispose(void *obj) =20 g_free(event->nsuri); } + + +static virObjectEvent * +virNetworkEventMetadataChangeNew(const char *name, + unsigned char *uuid, + int type, + const char *nsuri) +{ + virNetworkEventMetadataChange *event; + char uuidstr[VIR_UUID_STRING_BUFLEN]; + + if (virNetworkEventsInitialize() < 0) + return NULL; + + virUUIDFormat(uuid, uuidstr); + if (!(event =3D virObjectEventNew(virNetworkEventMetadataChangeClass, + virNetworkEventDispatchDefaultFunc, + VIR_NETWORK_EVENT_ID_METADATA_CHANGE, + 0, name, uuid, uuidstr))) + return NULL; + + event->type =3D type; + if (nsuri) + event->nsuri =3D g_strdup(nsuri); + + return (virObjectEvent *)event; +} + + +virObjectEvent * +virNetworkEventMetadataChangeNewFromObj(virNetworkObj *obj, + int type, + const char *nsuri) +{ + virNetworkDef *def =3D virNetworkObjGetDef(obj); + return virNetworkEventMetadataChangeNew(def->name, def->uuid, + type, nsuri); +} + + +virObjectEvent * +virNetworkEventMetadataChangeNewFromNet(virNetworkPtr net, + int type, + const char *nsuri) +{ + return virNetworkEventMetadataChangeNew(net->name, net->uuid, + type, nsuri); +} diff --git a/src/conf/network_event.h b/src/conf/network_event.h index 4502bfcaef..a91a238fed 100644 --- a/src/conf/network_event.h +++ b/src/conf/network_event.h @@ -23,6 +23,7 @@ =20 #include "internal.h" #include "object_event.h" +#include "virnetworkobj.h" =20 int virNetworkEventStateRegisterID(virConnectPtr conn, @@ -53,3 +54,13 @@ virNetworkEventLifecycleNew(const char *name, const unsigned char *uuid, int type, int detail); + +virObjectEvent * +virNetworkEventMetadataChangeNewFromObj(virNetworkObj *obj, + int type, + const char *nsuri); + +virObjectEvent * +virNetworkEventMetadataChangeNewFromNet(virNetworkPtr net, + int type, + const char *nsuri); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 1e3e407097..7a59828af0 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -861,6 +861,8 @@ virPortGroupFindByName; =20 # conf/network_event.h virNetworkEventLifecycleNew; +virNetworkEventMetadataChangeNewFromNet; +virNetworkEventMetadataChangeNewFromObj; virNetworkEventStateRegisterID; =20 =20 --=20 2.42.0 From nobody Fri May 10 10:54:05 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 Reviewed-by: Michal Privoznik --- 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 From nobody Fri May 10 10:54:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1693753615; cv=none; d=zohomail.com; s=zohoarc; b=eoIYJmqYuVkY9MqycN4lOCkjOW/FsclISF/w/qzqVP08gW9CWRqpYcRjttVg5zYKt+/oyuq4eVuoPwnVCBBjx9A4NrBbwWwT5h5iqjEIo8xbZGFRv1fJbkUsW2iX3JGopVuyVvsZIxTc+PC8/S7b6JkC4uihq/rf4+267Hccb8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693753615; 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=/s3U13X9e14oNnvAloUteabu1cvmoHMH//3ZbnWWWnA=; b=MyBNONNPhRP9IugpWCvNek1oueY8GOnp7lpOJ6njNao1+aF6AIi34+2SUNWu+N0znbAPFvCDcisxNjFoBuqbdn8kk3hqy9UaKzD+4fz3VwgqY7DYRiG4bwVaVCZLxwy0qQUi9hFhv/7IXYJv/rrg4sNTnfg7J90nG+14GqeihA4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 169375361509385.23941325535498; Sun, 3 Sep 2023 08:06:55 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-417-kSCGQJagM3-Lg4MeaWpucg-1; Sun, 03 Sep 2023 11:06:50 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D93AF1817917; 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 C5CD31460FFA; 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 536A41946A6A; Sun, 3 Sep 2023 15:06:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E88B61946586 for ; Sun, 3 Sep 2023 15:06:45 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CFEF1525720; Sun, 3 Sep 2023 15:06:45 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C861D493114 for ; Sun, 3 Sep 2023 15:06:45 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-inbound-delivery-1.mimecast.com [207.211.31.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 A8C7A3806714 for ; Sun, 3 Sep 2023 15:06:45 +0000 (UTC) Received: from mx0.riseup.net (mx0.riseup.net [198.252.153.6]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-511-pfcapRoFP0Gg_QnI2Q7GKQ-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 mx0.riseup.net (Postfix) with ESMTPS id 4Rdw8g0Dv4z9tGn for ; Sun, 3 Sep 2023 15:06:43 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4Rdw8d6D3WzFq1y; Sun, 3 Sep 2023 15:06:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693753614; 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=/s3U13X9e14oNnvAloUteabu1cvmoHMH//3ZbnWWWnA=; b=MWdQv/nVW6HngHNYIkLckIZR7/hATmF05iugfQbbf8hMhIdiebykNT1yWBy2BHrccYOLGH ShUgzFqIF5UDmWUjKA8Elj2RgRThMGO1ux8zpfxvZkZkOfZW0BkSQsEzTixAjjGzA1Smus 9mywKkIG7+u4fXwD1pfkMU8a8IYbsKk= X-MC-Unique: kSCGQJagM3-Lg4MeaWpucg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: pfcapRoFP0Gg_QnI2Q7GKQ-1 X-Riseup-User-ID: 2DEC5D66697F5B6F414F2B19843F7220F51F4D71486C6B3463D132F275F73FAF From: K Shiva Kiran To: libvir-list@redhat.com Subject: [PATCH 6/8] Test driver implementation for Network metadata change callbacks Date: Sun, 3 Sep 2023 20:28:38 +0530 Message-ID: <20230903150541.200896-7-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.10 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.7 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: 1693753615655100006 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: K Shiva Kiran Reviewed-by: Michal Privoznik --- src/test/test_driver.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 0174b28bac..0144df164e 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -9989,6 +9989,7 @@ testNetworkSetMetadata(virNetworkPtr net, const char *uri, unsigned int flags) { + testDriver *privconn =3D net->conn->privateData; virNetworkObj *privnet; int ret; =20 @@ -10002,6 +10003,12 @@ testNetworkSetMetadata(virNetworkPtr net, key, uri, NULL, NULL, NULL, flags); =20 + if (ret =3D=3D 0) { + virObjectEvent *ev =3D NULL; + ev =3D virNetworkEventMetadataChangeNewFromObj(privnet, type, uri); + virObjectEventStateQueue(privconn->eventState, ev); + } + virNetworkObjEndAPI(&privnet); return ret; } --=20 2.42.0 From nobody Fri May 10 10:54:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1693753620; cv=none; d=zohomail.com; s=zohoarc; b=ETupKFxKLlQNADlcpAC8RpyvhK7mo7RHDC5YYcEQBAGD1d/DY8yxCgzGcKotu6XdvNK5fMUEVLic8VNFXAcKGDtWoRB4AdM+Cx6VJ8DBhUfA66qsFyfExrjj4n+vmU0fLXzdTBWf7/xudBD3ewh2UN0sVWFvM6lL+6W95dVdSEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693753620; 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=NYrI+EYuUvkR4MAjEHvsH/7My9ri3YjAWuWjuN8FQwc=; b=kdyCaQ+bioNXSo7JDfPFdrz+rE+lT3tVJaUhyOFtQyjm5yX8SH3QLVFAKT4/7MQUJSlwbnxMpNn8r9Xph90SlVwMQ6nIqRPJrdh9nikWQOm/Fv0sztx3/wsM4GrquyCHKk+nN/sHxw+2FrBJXI6P4oSa+H9U/BG13FfJxjQnRkU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1693753620727840.0506730944566; Sun, 3 Sep 2023 08:07:00 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-491-vRcQyIgjNQitKLnF8w5Fzw-1; Sun, 03 Sep 2023 11:06:52 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C112E1817904; Sun, 3 Sep 2023 15:06:49 +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 AE7AC1460FFA; Sun, 3 Sep 2023 15:06:49 +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 9165119465A8; Sun, 3 Sep 2023 15:06:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B8BE319465BD for ; Sun, 3 Sep 2023 15:06:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8BF071460FFB; Sun, 3 Sep 2023 15:06:47 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 845461460FFA for ; Sun, 3 Sep 2023 15:06:47 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 6809693A9A6 for ; Sun, 3 Sep 2023 15:06:47 +0000 (UTC) Received: from mx0.riseup.net (mx0.riseup.net [198.252.153.6]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-549-z4k9Z85BN7q12-s4lgIJMg-1; Sun, 03 Sep 2023 11:06:45 -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 mx0.riseup.net (Postfix) with ESMTPS id 4Rdw8h4yKpz9tGn for ; Sun, 3 Sep 2023 15:06:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4Rdw8g3hbbzFq1y; Sun, 3 Sep 2023 15:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693753619; 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=NYrI+EYuUvkR4MAjEHvsH/7My9ri3YjAWuWjuN8FQwc=; b=aPlKn8fvs188D/XSopRqjhZ3GpTh8iPbiBwqZf62VdubNsxm/mY16ykJv1123ziAVSJSIz HJZcimMjvxGNwFHSxU96/0W8zqNb4+R8BMsEdSFfdaxlIz+l4CtQCM14uwY7O2wexLGgdY WMUG+K0xZvgkEUHj+Ey1IHTvALGExyA= X-MC-Unique: vRcQyIgjNQitKLnF8w5Fzw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: z4k9Z85BN7q12-s4lgIJMg-1 X-Riseup-User-ID: 4FA2137808F8A537099FACB13C63E3DA3CB1FE313FC28554C9E3CBC3158A2488 From: K Shiva Kiran To: libvir-list@redhat.com Subject: [PATCH 7/8] Add Bridge Driver implementation for Network metadata change callbacks Date: Sun, 3 Sep 2023 20:28:39 +0530 Message-ID: <20230903150541.200896-8-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.7 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.7 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: 1693753621831100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: K Shiva Kiran Reviewed-by: Michal Privoznik --- src/network/bridge_driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index caad085192..34c88278cd 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -5149,6 +5149,12 @@ networkSetMetadata(virNetworkPtr net, driver->xmlopt, cfg->stateDir, cfg->networkConfigDir, flags); =20 + if (ret =3D=3D 0) { + virObjectEvent *event =3D NULL; + event =3D virNetworkEventMetadataChangeNewFromObj(obj, type, uri); + virObjectEventStateQueue(driver->networkEventState, event); + } + cleanup: virNetworkObjEndAPI(&obj); return ret; --=20 2.42.0 From nobody Fri May 10 10:54:05 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=1693753619; cv=none; d=zohomail.com; s=zohoarc; b=Z0otk9oO36VvFCRRDiX9e5MS5CQBupedWUr8tSISC7vEFqAZo4TVHFASeDSUlOft+yRCXdFrIzr3B6/2z+nUWzR8Ww7icaLCnjbmgzowRZieAn9HAp8K3rLb3D0eV6RcKVqo894FfS98Y7FIPjv4pMfrE09ZtBdiSfqW1YurQQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693753619; 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=WnZIP7zXhKqMAvHJ1xTrPG1XmT7HbgGEr4Hia6XP0XI=; b=D9SIdo8WUkf7MNaA/5sg0mhlDMUr67Fvfdm35103QpDfJoEpgMg2X8zpFMm8QFqmwcAXxC/yA14zbmgPgjXV1czoYotwSHCxCp2fmo2su/hDNVMw+W7FuNtrLAPZivzwQmYBgMal0cLVLYqVTB3icFvEqDd8OEBKxeLvssGkEhs= 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 1693753619772224.94228530804082; Sun, 3 Sep 2023 08:06:59 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-642-JCzPQHbzOt-QZD1ZmqcrRQ-1; Sun, 03 Sep 2023 11:06:54 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4D70C8F9061; Sun, 3 Sep 2023 15:06:51 +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 39C8F1460FFA; Sun, 3 Sep 2023 15:06:51 +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 26C0E19465A8; Sun, 3 Sep 2023 15:06:51 +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 3AFC119465BD for ; Sun, 3 Sep 2023 15:06:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2AACB200A86A; Sun, 3 Sep 2023 15:06:49 +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 22EF42012F37 for ; Sun, 3 Sep 2023 15:06:49 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 06F4C872912 for ; Sun, 3 Sep 2023 15:06:49 +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-641-EO6Ss5eCOuChzefNH0dg7w-1; Sun, 03 Sep 2023 11:06:47 -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 4Rdw8k2TfDzDqJS for ; Sun, 3 Sep 2023 15:06:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4Rdw8j1HnNzFpfK; Sun, 3 Sep 2023 15:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693753618; 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=WnZIP7zXhKqMAvHJ1xTrPG1XmT7HbgGEr4Hia6XP0XI=; b=LxDn6Jo+ugqnCi+rOlrZf+TY9+vNG8Kt6R//D8WhlxqHD2SN8MyS8dqp77dm2PYz6iE+oU HxFVXcdjsgbLGtOLg4zVt7KnwyodwEaaUVctx7MW2BQzXp09JqfIam6CCnMKxuan4Dgkzz FrwcRnAcMlLbGXNfXV/qH0az15uQdY0= X-MC-Unique: JCzPQHbzOt-QZD1ZmqcrRQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: EO6Ss5eCOuChzefNH0dg7w-1 X-Riseup-User-ID: 05571ACE477DA6257B962895B0A6EADD8C2B7BA9959254FA4A447504B881F5B0 From: K Shiva Kiran To: libvir-list@redhat.com Subject: [PATCH 8/8] examples: Add Testing for metadata change callbacks Date: Sun, 3 Sep 2023 20:28:40 +0530 Message-ID: <20230903150541.200896-9-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.7 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: 1693753621848100002 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: K Shiva Kiran Reviewed-by: Michal Privoznik --- examples/c/misc/event-test.c | 85 ++++++++++++++++++++++++++++++++---- 1 file changed, 76 insertions(+), 9 deletions(-) diff --git a/examples/c/misc/event-test.c b/examples/c/misc/event-test.c index 64652b0153..813bca2699 100644 --- a/examples/c/misc/event-test.c +++ b/examples/c/misc/event-test.c @@ -1065,6 +1065,43 @@ myDomainEventMetadataChangeCallback(virConnectPtr co= nn G_GNUC_UNUSED, } =20 =20 +static const char * +networkMetadataTypeToStr(int type) +{ + switch ((virNetworkMetadataType) type) { + case VIR_NETWORK_METADATA_DESCRIPTION: + return "description"; + + case VIR_NETWORK_METADATA_TITLE: + return "title"; + + case VIR_NETWORK_METADATA_ELEMENT: + return "element"; + + case VIR_NETWORK_METADATA_LAST: + break; + } + return "unknown"; +} + +static int +myNetworkEventMetadataChangeCallback(virConnectPtr conn G_GNUC_UNUSED, + virNetworkPtr net, + int type, + const char *nsuri, + void *opaque G_GNUC_UNUSED) +{ + const char *typestr =3D networkMetadataTypeToStr(type); + char uuid[VIR_UUID_STRING_BUFLEN]; + virNetworkGetUUIDString(net, uuid); + + printf("%s EVENT: Network: (%s) uuid: (%s) metadata type: (%s) nsuri: = (%s)\n", + __func__, virNetworkGetName(net), uuid, typestr, nsuri ? nsuri = : "n/a"); + + return 0; +} + + =20 static void myFreeFunc(void *opaque) @@ -1170,11 +1207,27 @@ struct secretEventData secretEvents[] =3D { SECRET_EVENT(VIR_SECRET_EVENT_ID_VALUE_CHANGED, mySecretEventValueChan= ged), }; =20 +struct networkEventData { + int event; + int id; + virConnectNetworkEventGenericCallback cb; + const char *name; +}; + +#define NETWORK_EVENT(event, callback) \ + {event, -1, VIR_NETWORK_EVENT_CALLBACK(callback), #event} + +struct networkEventData networkEvents[] =3D { + NETWORK_EVENT(VIR_NETWORK_EVENT_ID_LIFECYCLE, myNetworkEventCallback), + NETWORK_EVENT(VIR_NETWORK_EVENT_ID_METADATA_CHANGE, myNetworkEventMeta= dataChangeCallback), +}; + /* make sure that the events are kept in sync */ G_STATIC_ASSERT(G_N_ELEMENTS(domainEvents) =3D=3D VIR_DOMAIN_EVENT_ID_LAST= ); G_STATIC_ASSERT(G_N_ELEMENTS(storagePoolEvents) =3D=3D VIR_STORAGE_POOL_EV= ENT_ID_LAST); G_STATIC_ASSERT(G_N_ELEMENTS(nodeDeviceEvents) =3D=3D VIR_NODE_DEVICE_EVEN= T_ID_LAST); G_STATIC_ASSERT(G_N_ELEMENTS(secretEvents) =3D=3D VIR_SECRET_EVENT_ID_LAST= ); +G_STATIC_ASSERT(G_N_ELEMENTS(networkEvents) =3D=3D VIR_NETWORK_EVENT_ID_LA= ST); =20 int main(int argc, char **argv) @@ -1182,7 +1235,6 @@ main(int argc, char **argv) int ret =3D EXIT_FAILURE; virConnectPtr dconn =3D NULL; int callback1ret =3D -1; - int callback16ret =3D -1; size_t i; =20 if (argc > 1 && STREQ(argv[1], "--help")) { @@ -1241,11 +1293,21 @@ main(int argc, char **argv) } } =20 - callback16ret =3D virConnectNetworkEventRegisterAny(dconn, - NULL, - VIR_NETWORK_EVENT_ID= _LIFECYCLE, - VIR_NETWORK_EVENT_CA= LLBACK(myNetworkEventCallback), - strdup("net callback= "), myFreeFunc); + /* register common network callbacks */ + for (i =3D 0; i < G_N_ELEMENTS(networkEvents); i++) { + struct networkEventData *event =3D networkEvents + i; + + event->id =3D virConnectNetworkEventRegisterAny(dconn, NULL, + event->event, + event->cb, + strdup(event->name), + myFreeFunc); + + if (event->id < 0) { + fprintf(stderr, "Failed to register event '%s'\n", event->name= ); + goto cleanup; + } + } =20 /* register common storage pool callbacks */ for (i =3D 0; i < G_N_ELEMENTS(storagePoolEvents); i++) { @@ -1295,8 +1357,7 @@ main(int argc, char **argv) } } =20 - if ((callback1ret =3D=3D -1) || - (callback16ret =3D=3D -1)) + if (callback1ret =3D=3D -1) goto cleanup; =20 if (virConnectSetKeepAlive(dconn, 5, 3) < 0) { @@ -1314,7 +1375,6 @@ main(int argc, char **argv) =20 printf("Deregistering event callbacks\n"); virConnectDomainEventDeregister(dconn, myDomainEventCallback1); - virConnectNetworkEventDeregisterAny(dconn, callback16ret); =20 =20 printf("Deregistering domain event callbacks\n"); @@ -1324,6 +1384,13 @@ main(int argc, char **argv) } =20 =20 + printf("Deregistering network event callbacks\n"); + for (i =3D 0; i < G_N_ELEMENTS(networkEvents); i++) { + if (networkEvents[i].id > 0) + virConnectNetworkEventDeregisterAny(dconn, networkEvents[i].id= ); + } + + printf("Deregistering storage pool event callbacks\n"); for (i =3D 0; i < G_N_ELEMENTS(storagePoolEvents); i++) { if (storagePoolEvents[i].id > 0) --=20 2.42.0 From nobody Fri May 10 10:54:05 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=1693756844; cv=none; d=zohomail.com; s=zohoarc; b=K4LfE1gpXbpcYGkqEZBmt74+8N7a9MfC0eTkQwji0iWvbBcaRT8A5V/kiP4qLqZ7NY/bkXASGPRDx2mZU8iqczU2aVJigc6Hgr3nGUhi6EhKZg9Cd+6DjKUIXwAdKsbE7NRMqcegRP8mDm7HqOiAl4W32xL0H1vYeBOjCRJhges= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693756844; 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=/OXICrlaeTvlwxErd6kjFKJ4DDaOiGdoWYJnzFHY4xc=; b=C4qreAQf/DXncgvegXbwUydEOj1JreWHMqS09G02hazJc3RRvZ08aVZkAs2Ta7fC2o7VgdAuEG+x8cL6oyK0Q7bE7J6IcBleRoAI42B4NGXRkDgW7H+7fh00pGls3gbmX3+FJy0hX0/pX++Uo+88KQfet7KVY0DsDyQMGnNS5IE= 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 1693756844547715.3145559153114; Sun, 3 Sep 2023 09:00:44 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-216-uue6vyEWOZGkyBXvw8P9mQ-1; Sun, 03 Sep 2023 12:00:37 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A640D925FCB; Sun, 3 Sep 2023 16:00:34 +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 F0E511182EC; Sun, 3 Sep 2023 16:00:33 +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 A621C1946597; Sun, 3 Sep 2023 16:00:33 +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 22A871946597 for ; Sun, 3 Sep 2023 16:00:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E0107200DA3D; Sun, 3 Sep 2023 16:00:31 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D929F200A4B6 for ; Sun, 3 Sep 2023 16:00:31 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-inbound-delivery-1.mimecast.com [205.139.110.61]) (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 AB6A029AA3BF for ; Sun, 3 Sep 2023 16:00:31 +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-470-0-0R9n6YNdOZfFru5nu15w-1; Sun, 03 Sep 2023 12:00:29 -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 4RdxLg6hY3zDrRv for ; Sun, 3 Sep 2023 16:00:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4RdxLf5582zFq1y; Sun, 3 Sep 2023 16:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693756843; 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=/OXICrlaeTvlwxErd6kjFKJ4DDaOiGdoWYJnzFHY4xc=; b=QdJGJ/TY1w9oQkImT3u9lqm2OTVkHe0dwNlgLNfAgz6WXhisJG5Cnp/pVGPrjOJkpN49JF 5z79Qxc/+MBHO7RlpvwwnrJ7WQdaj+MOOfdzJYMsINZjDkoy90WMs8KvXP7tZVRgDWmkeF PbnPqTBMBo4+1b09Bx3UQ85YodpPFuk= X-MC-Unique: uue6vyEWOZGkyBXvw8P9mQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 0-0R9n6YNdOZfFru5nu15w-1 X-Riseup-User-ID: 8098E0A7480FF9C1A6DEABA7BA75CB89607EFB52E834C368A6D169CA50DBFC8B From: K Shiva Kiran To: libvir-list@redhat.com Subject: [PATCH] NEWS: Introduce new event for network metadata changes Date: Sun, 3 Sep 2023 21:30:50 +0530 Message-ID: <20230903160055.212320-1-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.5 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: 1693756845259100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: K Shiva Kiran Reviewed-by: Michal Privoznik --- NEWS.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index a03ef20bc2..3381637fe5 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -15,6 +15,12 @@ v9.8.0 (unreleased) =20 * **Removed features** =20 + * New event for metadata changes in Networks + + The network object now has a new event ID ``VIR_NETWORK_EVENT_ID_METAD= ATA_CHANGE`` + that can be used to get notifications upon changes in any of ``= ``, + ``<description>`` or ``<metadata>``. + * **New features** =20 * **Improvements** --=20 2.42.0