Commit 293a8b54 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Add compat for 1.2.14 release

Signed-off-by: default avatarDaniel P. Berrange <[email protected]>
parent 1f7239ad
......@@ -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.15 onwards, through conditional compilation of newer APIs.
from 1.2.14 onwards, through conditional compilation of newer APIs.
## Documentation
......
......@@ -3718,7 +3718,10 @@ func (d *Domain) PMWakeup(flags uint32) error {
}
func (d *Domain) AddIOThread(id uint, flags uint32) error {
ret := C.virDomainAddIOThread(d.ptr, C.uint(id), C.uint(flags))
if C.LIBVIR_VERSION_NUMBER < 1002015 {
return GetNotImplementedError()
}
ret := C.virDomainAddIOThreadCompat(d.ptr, C.uint(id), C.uint(flags))
if ret == -1 {
return GetLastError()
}
......@@ -3727,7 +3730,10 @@ func (d *Domain) AddIOThread(id uint, flags uint32) error {
}
func (d *Domain) DelIOThread(id uint, flags uint32) error {
ret := C.virDomainDelIOThread(d.ptr, C.uint(id), C.uint(flags))
if C.LIBVIR_VERSION_NUMBER < 1002015 {
return GetNotImplementedError()
}
ret := C.virDomainDelIOThreadCompat(d.ptr, C.uint(id), C.uint(flags))
if ret == -1 {
return GetLastError()
}
......
......@@ -6,6 +6,30 @@ package libvirt
#include <assert.h>
#include "domain_compat.h"
int virDomainAddIOThreadCompat(virDomainPtr domain,
unsigned int iothread_id,
unsigned int flags)
{
#if LIBVIR_VERSION_NUMBER < 1002015
assert(0); // Caller should have checked version
#else
return virDomainAddIOThread(domain, iothread_id, flags);
#endif
}
int virDomainDelIOThreadCompat(virDomainPtr domain,
unsigned int iothread_id,
unsigned int flags)
{
#if LIBVIR_VERSION_NUMBER < 1002015
assert(0); // Caller should have checked version
#else
return virDomainDelIOThread(domain, iothread_id, flags);
#endif
}
int virDomainSetUserPasswordCompat(virDomainPtr dom,
const char *user,
const char *password,
......
#ifndef LIBVIRT_GO_DOMAIN_COMPAT_H__
#define LIBVIRT_GO_ERROR_COMPAT_H__
/* 1.2.15 */
#ifndef VIR_DOMAIN_JOB_DOWNTIME_NET
#define VIR_DOMAIN_JOB_DOWNTIME_NET "downtime_net"
#endif
#ifndef VIR_DOMAIN_JOB_TIME_ELAPSED_NET
#define VIR_DOMAIN_JOB_TIME_ELAPSED_NET "time_elapsed_net"
#endif
#ifndef VIR_DOMAIN_EVENT_ID_DEVICE_ADDED
#define VIR_DOMAIN_EVENT_ID_DEVICE_ADDED 19
#endif
int virDomainAddIOThreadCompat(virDomainPtr domain,
unsigned int iothread_id,
unsigned int flags);
int virDomainDelIOThreadCompat(virDomainPtr domain,
unsigned int iothread_id,
unsigned int flags);
/* 1.2.16 */
#ifndef VIR_DOMAIN_PASSWORD_ENCRYPTED
......
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