Commit b3f8da01 authored by Erik Skultety's avatar Erik Skultety

connect: Add the new libvirt API virConnectGetStoragePoolCapabilities

Signed-off-by: 's avatarErik Skultety <eskultet@redhat.com>
Reviewed-by: 's avatarDaniel P. Berrangé <berrange@redhat.com>
parent 990578ed
......@@ -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
}
......@@ -1761,6 +1761,23 @@ virStreamNewWrapper(virConnectPtr conn,
}
char *
virConnectGetStoragePoolCapabilitiesWrapper(virConnectPtr conn,
unsigned int flags,
virErrorPtr err)
{
#if LIBVIR_VERSION_NUMBER < 5002000
assert(0); // Caller should have checked version
#else
char *ret = virConnectGetStoragePoolCapabilities(conn, flags);
if (!ret) {
virCopyLastError(err);
}
return ret;
#endif
}
////////////////////////////////////////////////
*/
import "C"
......@@ -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__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment