Commit 4ac334a6 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Add virDomainSetBlockThreshold API binding

Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
parent 7e9adaf5
......@@ -4311,3 +4311,18 @@ func (d *Domain) SetVcpu(cpus []bool, state bool, flags uint32) error {
return nil
}
func (d *Domain) SetBlockThreshold(dev string, threshold uint64, flags uint32) error {
if C.LIBVIR_VERSION_NUMBER < 3002000 {
return GetNotImplementedError("virDomainSetBlockThreshold")
}
cdev := C.CString(dev)
defer C.free(unsafe.Pointer(cdev))
ret := C.virDomainSetBlockThresholdCompat(d.ptr, cdev, C.ulonglong(threshold), C.uint(flags))
if ret == -1 {
return GetLastError()
}
return nil
}
......@@ -298,5 +298,18 @@ int virDomainSetVcpuCompat(virDomainPtr domain,
#endif
}
int virDomainSetBlockThresholdCompat(virDomainPtr domain,
const char *dev,
unsigned long long threshold,
unsigned int flags)
{
#if LIBVIR_VERSION_NUMBER < 3002000
assert(0); // Caller should have checked version
#else
return virDomainSetBlockThreshold(domain, dev, threshold, flags);
#endif
}
*/
import "C"
......@@ -890,4 +890,9 @@ int virDomainSetVcpuCompat(virDomainPtr domain,
#define VIR_MIGRATE_TLS 1 << 16
#endif
int virDomainSetBlockThresholdCompat(virDomainPtr domain,
const char *dev,
unsigned long long threshold,
unsigned int flags);
#endif /* LIBVIRT_GO_DOMAIN_COMPAT_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