Commit 1f7239ad authored by Daniel P. Berrange's avatar Daniel P. Berrange

Add compat for 1.2.15 release

Signed-off-by: default avatarDaniel P. Berrange <[email protected]>
parent 513595e4
......@@ -7,7 +7,7 @@ Make sure to have `libvirt-dev` package (or the development files otherwise some
## Version Support
The libvirt go package provides API coverage for libvirt versions
from 1.2.16 onwards, through conditional compilation of newer APIs.
from 1.2.15 onwards, through conditional compilation of newer APIs.
## Documentation
......
......@@ -3492,13 +3492,16 @@ func (d *Domain) SetTime(secs int64, nsecs uint, flags uint32) error {
}
func (d *Domain) SetUserPassword(user string, password string, flags DomainSetUserPasswordFlags) error {
if C.LIBVIR_VERSION_NUMBER < 1002015 {
return GetNotImplementedError()
}
cuser := C.CString(user)
cpassword := C.CString(password)
defer C.free(cuser)
defer C.free(cpassword)
ret := C.virDomainSetUserPassword(d.ptr, cuser, cpassword, C.uint(flags))
ret := C.virDomainSetUserPasswordCompat(d.ptr, cuser, cpassword, C.uint(flags))
if ret == -1 {
return GetLastError()
}
......
......@@ -6,6 +6,19 @@ package libvirt
#include <assert.h>
#include "domain_compat.h"
int virDomainSetUserPasswordCompat(virDomainPtr dom,
const char *user,
const char *password,
unsigned int flags)
{
#if LIBVIR_VERSION_NUMBER < 1002016
assert(0); // Caller should have checked version
#else
return virDomainSetUserPassword(dom, user, password, flags);
#endif
}
int virDomainRenameCompat(virDomainPtr dom,
const char *new_name,
unsigned int flags)
......
#ifndef LIBVIRT_GO_DOMAIN_COMPAT_H__
#define LIBVIRT_GO_ERROR_COMPAT_H__
/* 1.2.16 */
#ifndef VIR_DOMAIN_PASSWORD_ENCRYPTED
#define VIR_DOMAIN_PASSWORD_ENCRYPTED 1 << 0
#endif
int virDomainSetUserPasswordCompat(virDomainPtr dom,
const char *user,
const char *password,
unsigned int flags);
/* 1.2.17 */
#ifndef VIR_DOMAIN_EVENT_WATCHDOG_INJECTNMI
......
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