Commit 659066f8 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Add compat for 1.2.6 release

Signed-off-by: default avatarDaniel P. Berrange <[email protected]>
parent 7f315eea
......@@ -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.7 onwards, through conditional compilation of newer APIs.
from 1.2.6 onwards, through conditional compilation of newer APIs.
## Documentation
......
......@@ -1845,6 +1845,9 @@ func (c *Connect) GetCPUModelNames(arch string, flags uint32) ([]string, error)
}
func (c *Connect) GetDomainCapabilities(emulatorbin string, arch string, machine string, virttype string, flags uint32) (string, error) {
if C.LIBVIR_VERSION_NUMBER < 1002007 {
return "", GetNotImplementedError()
}
var cemulatorbin *C.char
if emulatorbin != "" {
cemulatorbin = C.CString(emulatorbin)
......@@ -1866,7 +1869,7 @@ func (c *Connect) GetDomainCapabilities(emulatorbin string, arch string, machine
defer C.free(cvirttype)
}
ret := C.virConnectGetDomainCapabilities(c.ptr, cemulatorbin, carch, cmachine, cvirttype, C.uint(flags))
ret := C.virConnectGetDomainCapabilitiesCompat(c.ptr, cemulatorbin, carch, cmachine, cvirttype, C.uint(flags))
if ret == nil {
return "", GetLastError()
}
......
......@@ -6,6 +6,20 @@ package libvirt
#include <assert.h>
#include "connect_compat.h"
char * virConnectGetDomainCapabilitiesCompat(virConnectPtr conn,
const char *emulatorbin,
const char *arch,
const char *machine,
const char *virttype,
unsigned int flags)
{
#if LIBVIR_VERSION_NUMBER < 1002007
assert(0); // Caller should have checked version
#else
return virConnectGetDomainCapabilities(conn, emulatorbin, arch, machine, virttype, flags);
#endif
}
int virConnectGetAllDomainStatsCompat(virConnectPtr conn,
unsigned int stats,
virDomainStatsRecordPtr **retStats,
......
#ifndef LIBVIRT_GO_CONNECT_COMPAT_H_
#define LIBVIRT_GO_CONNECT_COMPAT_H_
/* 1.2.7 */
char * virConnectGetDomainCapabilitiesCompat(virConnectPtr conn,
const char *emulatorbin,
const char *arch,
const char *machine,
const char *virttype,
unsigned int flags);
/* 1.2.8 */
#ifndef VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE
......
#ifndef LIBVIRT_GO_DOMAIN_COMPAT_H__
#define LIBVIRT_GO_ERROR_COMPAT_H__
/* 1.2.7 */
#ifndef VIR_DOMAIN_BLOCK_COMMIT_RELATIVE
#define VIR_DOMAIN_BLOCK_COMMIT_RELATIVE 1 << 3
#endif
#ifndef VIR_DOMAIN_BLOCK_REBASE_RELATIVE
#define VIR_DOMAIN_BLOCK_REBASE_RELATIVE 1 << 4
#endif
/* 1.2.8 */
#ifndef VIR_DOMAIN_BLOCK_COPY_SHALLOW
......
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