From nobody Wed Apr 24 23:01:02 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15523802977111014.8595436069446; Tue, 12 Mar 2019 01:44:57 -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 1B984C04B31A; Tue, 12 Mar 2019 08:44:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EBCFF66076; Tue, 12 Mar 2019 08:44:55 +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 97207181A13C; Tue, 12 Mar 2019 08:44:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2C8hgf4013359 for ; Tue, 12 Mar 2019 04:43:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id ED4035D71A; Tue, 12 Mar 2019 08:43:42 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4902A5D706; Tue, 12 Mar 2019 08:43:40 +0000 (UTC) From: Erik Skultety To: libvir-list@redhat.com Date: Tue, 12 Mar 2019 09:43:35 +0100 Message-Id: <41b6cad58cca108a92b1d95f0c876878cd56841d.1552380177.git.eskultet@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [libvirt-go PATCH] connect: Add the new libvirt API virConnectGetStoragePoolCapabilities 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: , 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]); Tue, 12 Mar 2019 08:44:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Erik Skultety --- connect.go | 17 +++++++++++++++++ connect_wrapper.go | 13 +++++++++++++ connect_wrapper.h | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/connect.go b/connect.go index 0d5118c..04badfc 100644 --- a/connect.go +++ b/connect.go @@ -2985,3 +2985,20 @@ func (c *Connect) NWFilterBindingCreateXML(xmlConfig= string, flags uint32) (*NWF } return &NWFilterBinding{ptr: ptr}, nil } + +// See also https://libvirt.org/html/libvirt-libvirt-storage.html#virConne= ctGetStoragePoolCapabilities +func (c *Connect) GetStoragePoolCapabilities(flags uint32) (string, error)= { + if C.LIBVIR_VERSION_NUMBER < 5002000 { + return "", makeNotImplementedError("virConnectGetStoragePoolCapabilities= ") + } + + var err C.virError + ret :=3D C.virConnectGetStoragePoolCapabilitiesWrapper(c.ptr, C.uint(flag= s), &err) + if ret =3D=3D nil { + return "", makeError(&err) + } + + defer C.free(unsafe.Pointer(ret)) + + return C.GoString(ret), nil +} diff --git a/connect_wrapper.go b/connect_wrapper.go index 89727d0..7be3361 100644 --- a/connect_wrapper.go +++ b/connect_wrapper.go @@ -1761,6 +1761,19 @@ virStreamNewWrapper(virConnectPtr conn, } =20 =20 +char * +virConnectGetStoragePoolCapabilitiesWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err) +{ + char * ret =3D virConnectGetStoragePoolCapabilities(conn, flags); + if (!ret) { + virCopyLastError(err); + } + return ret; +} + + //////////////////////////////////////////////// */ import "C" diff --git a/connect_wrapper.h b/connect_wrapper.h index 5c282d2..2e57ebd 100644 --- a/connect_wrapper.h +++ b/connect_wrapper.h @@ -726,5 +726,9 @@ virStreamNewWrapper(virConnectPtr conn, unsigned int flags, virErrorPtr err); =20 +char * +virConnectGetStoragePoolCapabilitiesWrapper(virConnectPtr conn, + unsigned int flags, + virErrorPtr err); =20 #endif /* LIBVIRT_GO_CONNECT_WRAPPER_H__ */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list