From nobody Sun Apr 28 06:42:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501860623792360.39128878906604; Fri, 4 Aug 2017 08:30:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 69E64C047B8A; Fri, 4 Aug 2017 15:30:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 49E7E60A9B; Fri, 4 Aug 2017 15:30:20 +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 D71C64A467; Fri, 4 Aug 2017 15:30:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v74FUGpj021617 for ; Fri, 4 Aug 2017 11:30:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9802667CFD; Fri, 4 Aug 2017 15:30:16 +0000 (UTC) Received: from t460.redhat.com (ovpn-117-145.ams2.redhat.com [10.36.117.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BD1E68D39; Fri, 4 Aug 2017 15:30:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 69E64C047B8A Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: "Daniel P. Berrange" To: libvir-list@redhat.com Date: Fri, 4 Aug 2017 16:30:03 +0100 Message-Id: <20170804153003.25680-1-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] Remove bogus warning about vir$OBJECTGetConnect functions 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 04 Aug 2017 15:30:22 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The API docs for the various vir$OBJECTGetConnect functions contain a warning WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the domain object together. There is no reason why language bindings should not use this method, and indeed the Perl, Python, and Go bindings all use these methods. This warning was originally added back in commit 3edb4bc9fb1b451599df58420d61ffd73633cead Author: Daniel Veillard Date: Tue Jul 24 15:32:55 2007 +0000 * libvirt.spec.in NEWS docs/* po/*: preparing release 0.3.1 * src/libvirt.c python/generator.py: some cleanup and warnings from Richard W.M. Jones IIUC, the rational was that these APIs do not need to be directly exposed to the non-C language, as the language can expose the same concept itself by storing the original virConnectPtr object alongside the virDomainPtr. There's no reason to mandate such an approach though - it is valid for languages to expose this directly if that suits their needs better. Signed-off-by: Daniel P. Berrange --- src/libvirt-domain-snapshot.c | 6 ------ src/libvirt-domain.c | 4 ---- src/libvirt-interface.c | 4 ---- src/libvirt-network.c | 4 ---- src/libvirt-secret.c | 3 --- src/libvirt-storage.c | 8 -------- 6 files changed, 29 deletions(-) diff --git a/src/libvirt-domain-snapshot.c b/src/libvirt-domain-snapshot.c index b7c566fec..953a586e5 100644 --- a/src/libvirt-domain-snapshot.c +++ b/src/libvirt-domain-snapshot.c @@ -57,9 +57,6 @@ virDomainSnapshotGetName(virDomainSnapshotPtr snapshot) * reference counter on the domain is not increased by this * call. * - * WARNING: When writing libvirt bindings in other languages, do not use t= his - * function. Instead, store the domain and the snapshot object together. - * * Returns the domain or NULL. */ virDomainPtr @@ -83,9 +80,6 @@ virDomainSnapshotGetDomain(virDomainSnapshotPtr snapshot) * reference counter on the connection is not increased by this * call. * - * WARNING: When writing libvirt bindings in other languages, do not use t= his - * function. Instead, store the connection and the snapshot object togeth= er. - * * Returns the connection or NULL. */ virConnectPtr diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 4033ae8e6..87fca29c4 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -115,10 +115,6 @@ virConnectNumOfDomains(virConnectPtr conn) * reference counter on the connection is not increased by this * call. * - * WARNING: When writing libvirt bindings in other languages, do - * not use this function. Instead, store the connection and - * the domain object together. - * * Returns the virConnectPtr or NULL in case of failure. */ virConnectPtr diff --git a/src/libvirt-interface.c b/src/libvirt-interface.c index 3d1a5ff8d..7c8996c58 100644 --- a/src/libvirt-interface.c +++ b/src/libvirt-interface.c @@ -35,10 +35,6 @@ VIR_LOG_INIT("libvirt.interface"); * reference counter on the connection is not increased by this * call. * - * WARNING: When writing libvirt bindings in other languages, do - * not use this function. Instead, store the connection and - * the interface object together. - * * Returns the virConnectPtr or NULL in case of failure. */ virConnectPtr diff --git a/src/libvirt-network.c b/src/libvirt-network.c index 3136f27ee..5c5a0ee22 100644 --- a/src/libvirt-network.c +++ b/src/libvirt-network.c @@ -36,10 +36,6 @@ VIR_LOG_INIT("libvirt.network"); * reference counter on the connection is not increased by this * call. * - * WARNING: When writing libvirt bindings in other languages, do - * not use this function. Instead, store the connection and - * the network object together. - * * Returns the virConnectPtr or NULL in case of failure. */ virConnectPtr diff --git a/src/libvirt-secret.c b/src/libvirt-secret.c index 8a99c8c26..d9244c252 100644 --- a/src/libvirt-secret.c +++ b/src/libvirt-secret.c @@ -34,9 +34,6 @@ VIR_LOG_INIT("libvirt.secret"); * Provides the connection pointer associated with a secret. The reference * counter on the connection is not increased by this call. * - * WARNING: When writing libvirt bindings in other languages, do not use t= his - * function. Instead, store the connection and the secret object together. - * * Returns the virConnectPtr or NULL in case of failure. */ virConnectPtr diff --git a/src/libvirt-storage.c b/src/libvirt-storage.c index 35f9926d5..2cefc3c91 100644 --- a/src/libvirt-storage.c +++ b/src/libvirt-storage.c @@ -36,10 +36,6 @@ VIR_LOG_INIT("libvirt.storage"); * reference counter on the connection is not increased by this * call. * - * WARNING: When writing libvirt bindings in other languages, do - * not use this function. Instead, store the connection and - * the pool object together. - * * Returns the virConnectPtr or NULL in case of failure. */ virConnectPtr @@ -1254,10 +1250,6 @@ virStoragePoolListVolumes(virStoragePoolPtr pool, * reference counter on the connection is not increased by this * call. * - * WARNING: When writing libvirt bindings in other languages, do - * not use this function. Instead, store the connection and - * the volume object together. - * * Returns the virConnectPtr or NULL in case of failure. */ virConnectPtr --=20 2.13.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list