Commit d86600ab authored by Daniel P. Berrange's avatar Daniel P. Berrange

Add compat for 1.2.2 release

Signed-off-by: default avatarDaniel P. Berrange <[email protected]>
parent 06288fe2
......@@ -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.3 onwards, through conditional compilation of newer APIs.
from 1.2.2 onwards, through conditional compilation of newer APIs.
## Documentation
......
......@@ -3605,10 +3605,13 @@ func (d *Domain) CoreDump(to string, flags uint32) error {
}
func (d *Domain) CoreDumpWithFormat(to string, format DomainCoreDumpFormat, flags uint32) error {
if C.LIBVIR_VERSION_NUMBER < 1002003 {
GetNotImplementedError()
}
cto := C.CString(to)
defer C.free(cto)
ret := C.virDomainCoreDumpWithFormat(d.ptr, cto, C.uint(format), C.uint(flags))
ret := C.virDomainCoreDumpWithFormatCompat(d.ptr, cto, C.uint(format), C.uint(flags))
if ret == -1 {
return GetLastError()
}
......
......@@ -6,6 +6,19 @@ package libvirt
#include <assert.h>
#include "domain_compat.h"
int virDomainCoreDumpWithFormatCompat(virDomainPtr domain,
const char *to,
unsigned int dumpformat,
unsigned int flags)
{
#if LIBVIR_VERSION_NUMBER < 1002003
assert(0); // Caller should have checked version
#else
return virDomainCoreDumpWithFormatCompat(domain, to, dumpformat, flags);
#endif
}
int virDomainGetTimeCompat(virDomainPtr dom,
long long *seconds,
unsigned int *nseconds,
......
#ifndef LIBVIRT_GO_DOMAIN_COMPAT_H__
#define LIBVIRT_GO_ERROR_COMPAT_H__
/* 1.2.3 */
#ifndef VIR_DOMAIN_CORE_DUMP_FORMAT_RAW
#define VIR_DOMAIN_CORE_DUMP_FORMAT_RAW 0
#endif
#ifndef VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB
#define VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB 1
#endif
#ifndef VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO
#define VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO 2
#endif
#ifndef VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY
#define VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY 3
#endif
#ifndef VIR_MIGRATE_AUTO_CONVERGE
#define VIR_MIGRATE_AUTO_CONVERGE 1 << 13
#endif
int virDomainCoreDumpWithFormatCompat(virDomainPtr domain,
const char *to,
unsigned int dumpformat,
unsigned int flags);
/* 1.2.5 */
#ifndef VIR_DOMAIN_REBOOT_PARAVIRT
......
#ifndef LIBVIRT_GO_ERROR_COMPAT_H__
#define LIBVIRT_GO_ERROR_COMPAT_H__
/* 1.2.3 */
#ifndef VIR_FROM_CRYPTO
#define VIR_FROM_CRYPTO 58
#endif
/* 1.2.4 */
#ifndef VIR_FROM_FIREWALL
......
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