[libvirt-go PATCH] connect: Add the new libvirt API virConnectGetStoragePoolCapabilities

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Erik Skultety <eskultet@xxxxxxxxxx>
---
 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#virConnectGetStoragePoolCapabilities
+func (c *Connect) GetStoragePoolCapabilities(flags uint32) (string, error) {
+	if C.LIBVIR_VERSION_NUMBER < 5002000 {
+		return "", makeNotImplementedError("virConnectGetStoragePoolCapabilities")
+	}
+
+	var err C.virError
+	ret := C.virConnectGetStoragePoolCapabilitiesWrapper(c.ptr, C.uint(flags), &err)
+	if ret == 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,
 }
 
 
+char *
+virConnectGetStoragePoolCapabilitiesWrapper(virConnectPtr conn,
+                                            unsigned int flags,
+                                            virErrorPtr err)
+{
+    char * ret = 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);
 
+char *
+virConnectGetStoragePoolCapabilitiesWrapper(virConnectPtr conn,
+                                            unsigned int flags,
+                                            virErrorPtr err);
 
 #endif /* LIBVIRT_GO_CONNECT_WRAPPER_H__ */
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux