Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
domain.go | 1 +
domain_compat.h | 141 -----------------------
domain_compat.go => domain_wrapper.go | 2 +-
domain_wrapper.h | 157 ++++++++++++++++++++++++++
4 files changed, 159 insertions(+), 142 deletions(-)
rename domain_compat.go => domain_wrapper.go (99%)
create mode 100644 domain_wrapper.h
diff --git a/domain.go b/domain.go
index 75c3458..7253c67 100644
--- a/domain.go
+++ b/domain.go
@@ -32,6 +32,7 @@ package libvirt
#include <libvirt/virterror.h>
#include <stdlib.h>
#include "domain_compat.h"
+#include "domain_wrapper.h"
*/
import "C"
diff --git a/domain_compat.h b/domain_compat.h
index 3a868fe..c0d93b6 100644
--- a/domain_compat.h
+++ b/domain_compat.h
@@ -68,11 +68,6 @@
#define VIR_MIGRATE_AUTO_CONVERGE 1 << 13
#endif
-int virDomainCoreDumpWithFormatWrapper(virDomainPtr domain,
- const char *to,
- unsigned int dumpformat,
- unsigned int flags);
-
/* 1.2.5 */
@@ -88,27 +83,6 @@ int virDomainCoreDumpWithFormatWrapper(virDomainPtr domain,
#define VIR_DOMAIN_TIME_SYNC 1 << 0
#endif
-int virDomainGetTimeWrapper(virDomainPtr dom,
- long long *seconds,
- unsigned int *nseconds,
- unsigned int flags);
-
-int virDomainSetTimeWrapper(virDomainPtr dom,
- long long seconds,
- unsigned int nseconds,
- unsigned int flags);
-
-int virDomainFSFreezeWrapper(virDomainPtr dom,
- const char **mountpoints,
- unsigned int nmountpoints,
- unsigned int flags);
-
-int virDomainFSThawWrapper(virDomainPtr dom,
- const char **mountpoints,
- unsigned int nmountpoints,
- unsigned int flags);
-
-
/* 1.2.6 */
#ifndef VIR_DOMAIN_BLOCK_COMMIT_ACTIVE
@@ -161,17 +135,6 @@ int virDomainFSThawWrapper(virDomainPtr dom,
#define VIR_DOMAIN_STATS_STATE 1 << 0
#endif
-int virDomainBlockCopyWrapper(virDomainPtr dom, const char *disk,
- const char *destxml,
- virTypedParameterPtr params,
- int nparams,
- unsigned int flags);
-
-int virDomainOpenGraphicsFDWrapper(virDomainPtr dom,
- unsigned int idx,
- unsigned int flags);
-
-
/* 1.2.9 */
#ifndef VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES
@@ -374,13 +337,6 @@ struct _virDomainFSInfo {
};
#endif
-void virDomainFSInfoFreeWrapper(virDomainFSInfoPtr info);
-
-int virDomainGetFSInfoWrapper(virDomainPtr dom,
- virDomainFSInfoPtr **info,
- unsigned int flags);
-
-
/* 1.2.12 */
#ifndef VIR_DOMAIN_DEFINE_VALIDATE
@@ -450,24 +406,6 @@ struct _virDomainInterface {
};
#endif
-int virDomainInterfaceAddressesWrapper(virDomainPtr dom,
- virDomainInterfacePtr **ifaces,
- unsigned int source,
- unsigned int flags);
-
-void virDomainInterfaceFreeWrapper(virDomainInterfacePtr iface);
-
-void virDomainIOThreadInfoFreeWrapper(virDomainIOThreadInfoPtr info);
-
-int virDomainGetIOThreadInfoWrapper(virDomainPtr domain,
- virDomainIOThreadInfoPtr **info,
- unsigned int flags);
-int virDomainPinIOThreadWrapper(virDomainPtr domain,
- unsigned int iothread_id,
- unsigned char *cpumap,
- int maplen,
- unsigned int flags);
-
/* 1.2.15 */
@@ -483,13 +421,6 @@ int virDomainPinIOThreadWrapper(virDomainPtr domain,
#define VIR_DOMAIN_EVENT_ID_DEVICE_ADDED 19
#endif
-int virDomainAddIOThreadWrapper(virDomainPtr domain,
- unsigned int iothread_id,
- unsigned int flags);
-int virDomainDelIOThreadWrapper(virDomainPtr domain,
- unsigned int iothread_id,
- unsigned int flags);
-
/* 1.2.16 */
@@ -497,11 +428,6 @@ int virDomainDelIOThreadWrapper(virDomainPtr domain,
#define VIR_DOMAIN_PASSWORD_ENCRYPTED 1 << 0
#endif
-int virDomainSetUserPasswordWrapper(virDomainPtr dom,
- const char *user,
- const char *password,
- unsigned int flags);
-
/* 1.2.17 */
@@ -528,10 +454,6 @@ int virDomainSetUserPasswordWrapper(virDomainPtr dom,
#define VIR_DOMAIN_EVENT_UNDEFINED_RENAMED 1
#endif
-int virDomainRenameWrapper(virDomainPtr dom,
- const char *new_name,
- unsigned int flags);
-
/* 1.3.1 */
@@ -617,18 +539,6 @@ int virDomainRenameWrapper(virDomainPtr dom,
#define VIR_DOMAIN_TUNABLE_CPU_GLOBAL_QUOTA "cputune.global_quota"
#endif
-int virDomainGetPerfEventsWrapper(virDomainPtr dom,
- virTypedParameterPtr *params,
- int *nparams,
- unsigned int flags);
-int virDomainSetPerfEventsWrapper(virDomainPtr dom,
- virTypedParameterPtr params,
- int nparams,
- unsigned int flags);
-int virDomainMigrateStartPostCopyWrapper(virDomainPtr domain,
- unsigned int flags);
-
-
/* 1.3.4 */
#ifndef VIR_MIGRATE_PARAM_COMPRESSION
@@ -685,17 +595,6 @@ int virDomainMigrateStartPostCopyWrapper(virDomainPtr domain,
#define VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT "auto_converge.increment"
#endif
-int virDomainGetGuestVcpusWrapper(virDomainPtr domain,
- virTypedParameterPtr *params,
- unsigned int *nparams,
- unsigned int flags);
-
-int virDomainSetGuestVcpusWrapper(virDomainPtr domain,
- const char *cpumap,
- int state,
- unsigned int flags);
-
-
/* 2.1.0 */
#ifndef VIR_DOMAIN_MEMORY_STAT_USABLE
@@ -876,13 +775,6 @@ int virDomainSetGuestVcpusWrapper(virDomainPtr domain,
#define VIR_DOMAIN_TUNABLE_BLKDEV_GROUP_NAME "blkdeviotune.group_name"
#endif
-/* 3.1.0 */
-
-int virDomainSetVcpuWrapper(virDomainPtr domain,
- const char *cpumap,
- int state,
- unsigned int flags);
-
/* 3.2.0 */
#ifndef VIR_MIGRATE_TLS
@@ -893,11 +785,6 @@ int virDomainSetVcpuWrapper(virDomainPtr domain,
#define VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD 24
#endif
-int virDomainSetBlockThresholdWrapper(virDomainPtr domain,
- const char *dev,
- unsigned long long threshold,
- unsigned int flags);
-
/* 3.3.0 */
#ifndef VIR_DOMAIN_JOB_OPERATION
@@ -959,18 +846,6 @@ int virDomainSetBlockThresholdWrapper(virDomainPtr domain,
#endif
-/* 3.7.0 */
-
-int virDomainMigrateGetMaxDowntimeWrapper(virDomainPtr domain,
- unsigned long long *downtime,
- unsigned int flags);
-
-char *virDomainManagedSaveGetXMLDescWrapper(virDomainPtr domain,
- unsigned int flags);
-int virDomainManagedSaveDefineXMLWrapper(virDomainPtr domain,
- const char *dxml,
- unsigned int flags);
-
/* 3.9.0 */
#ifndef VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE
@@ -1013,11 +888,6 @@ int virDomainManagedSaveDefineXMLWrapper(virDomainPtr domain,
#define VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART 5
#endif
-int virDomainSetLifecycleActionWrapper(virDomainPtr domain,
- unsigned int type,
- unsigned int action,
- unsigned int flags);
-
/* 4.2.0 */
#ifndef VIR_KEYCODE_SET_QNUM
@@ -1028,19 +898,8 @@ int virDomainSetLifecycleActionWrapper(virDomainPtr domain,
#define VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP 1
#endif
-
-/* 4.4.0 */
-
-int virDomainDetachDeviceAliasWrapper(virDomainPtr domain,
- const char *alias,
- unsigned int flags);
-
/* 4.5.0 */
-int virDomainGetLaunchSecurityInfoWrapper(virDomainPtr domain,
- virTypedParameterPtr *params,
- int *nparams,
- unsigned int flags);
#ifndef VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT
#define VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT "sev-measurement"
diff --git a/domain_compat.go b/domain_wrapper.go
similarity index 99%
rename from domain_compat.go
rename to domain_wrapper.go
index 345c28a..209af78 100644
--- a/domain_compat.go
+++ b/domain_wrapper.go
@@ -30,7 +30,7 @@ package libvirt
#cgo pkg-config: libvirt
#include <libvirt/libvirt.h>
#include <assert.h>
-#include "domain_compat.h"
+#include "domain_wrapper.h"
int virDomainCoreDumpWithFormatWrapper(virDomainPtr domain,
const char *to,
diff --git a/domain_wrapper.h b/domain_wrapper.h
new file mode 100644
index 0000000..ab2138e
--- /dev/null
+++ b/domain_wrapper.h
@@ -0,0 +1,157 @@
+/*
+ * This file is part of the libvirt-go project
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * Copyright (c) 2013 Alex Zorin
+ * Copyright (C) 2016 Red Hat, Inc.
+ *
+ */
+
+#ifndef LIBVIRT_GO_DOMAIN_WRAPPER_H__
+#define LIBVIRT_GO_DOMAIN_WRAPPER_H__
+
+
+int virDomainCoreDumpWithFormatWrapper(virDomainPtr domain,
+ const char *to,
+ unsigned int dumpformat,
+ unsigned int flags);
+
+
+int virDomainGetTimeWrapper(virDomainPtr dom,
+ long long *seconds,
+ unsigned int *nseconds,
+ unsigned int flags);
+
+int virDomainSetTimeWrapper(virDomainPtr dom,
+ long long seconds,
+ unsigned int nseconds,
+ unsigned int flags);
+
+int virDomainFSFreezeWrapper(virDomainPtr dom,
+ const char **mountpoints,
+ unsigned int nmountpoints,
+ unsigned int flags);
+
+int virDomainFSThawWrapper(virDomainPtr dom,
+ const char **mountpoints,
+ unsigned int nmountpoints,
+ unsigned int flags);
+
+
+int virDomainBlockCopyWrapper(virDomainPtr dom, const char *disk,
+ const char *destxml,
+ virTypedParameterPtr params,
+ int nparams,
+ unsigned int flags);
+
+int virDomainOpenGraphicsFDWrapper(virDomainPtr dom,
+ unsigned int idx,
+ unsigned int flags);
+
+
+void virDomainFSInfoFreeWrapper(virDomainFSInfoPtr info);
+
+int virDomainGetFSInfoWrapper(virDomainPtr dom,
+ virDomainFSInfoPtr **info,
+ unsigned int flags);
+
+
+int virDomainInterfaceAddressesWrapper(virDomainPtr dom,
+ virDomainInterfacePtr **ifaces,
+ unsigned int source,
+ unsigned int flags);
+
+void virDomainInterfaceFreeWrapper(virDomainInterfacePtr iface);
+
+void virDomainIOThreadInfoFreeWrapper(virDomainIOThreadInfoPtr info);
+
+int virDomainGetIOThreadInfoWrapper(virDomainPtr domain,
+ virDomainIOThreadInfoPtr **info,
+ unsigned int flags);
+int virDomainPinIOThreadWrapper(virDomainPtr domain,
+ unsigned int iothread_id,
+ unsigned char *cpumap,
+ int maplen,
+ unsigned int flags);
+
+int virDomainAddIOThreadWrapper(virDomainPtr domain,
+ unsigned int iothread_id,
+ unsigned int flags);
+int virDomainDelIOThreadWrapper(virDomainPtr domain,
+ unsigned int iothread_id,
+ unsigned int flags);
+
+int virDomainSetUserPasswordWrapper(virDomainPtr dom,
+ const char *user,
+ const char *password,
+ unsigned int flags);
+
+int virDomainRenameWrapper(virDomainPtr dom,
+ const char *new_name,
+ unsigned int flags);
+int virDomainGetPerfEventsWrapper(virDomainPtr dom,
+ virTypedParameterPtr *params,
+ int *nparams,
+ unsigned int flags);
+int virDomainSetPerfEventsWrapper(virDomainPtr dom,
+ virTypedParameterPtr params,
+ int nparams,
+ unsigned int flags);
+int virDomainMigrateStartPostCopyWrapper(virDomainPtr domain,
+ unsigned int flags);
+int virDomainGetGuestVcpusWrapper(virDomainPtr domain,
+ virTypedParameterPtr *params,
+ unsigned int *nparams,
+ unsigned int flags);
+
+int virDomainSetGuestVcpusWrapper(virDomainPtr domain,
+ const char *cpumap,
+ int state,
+ unsigned int flags);
+int virDomainSetVcpuWrapper(virDomainPtr domain,
+ const char *cpumap,
+ int state,
+ unsigned int flags);
+int virDomainSetBlockThresholdWrapper(virDomainPtr domain,
+ const char *dev,
+ unsigned long long threshold,
+ unsigned int flags);
+int virDomainMigrateGetMaxDowntimeWrapper(virDomainPtr domain,
+ unsigned long long *downtime,
+ unsigned int flags);
+
+char *virDomainManagedSaveGetXMLDescWrapper(virDomainPtr domain,
+ unsigned int flags);
+int virDomainManagedSaveDefineXMLWrapper(virDomainPtr domain,
+ const char *dxml,
+ unsigned int flags);
+int virDomainSetLifecycleActionWrapper(virDomainPtr domain,
+ unsigned int type,
+ unsigned int action,
+ unsigned int flags);
+int virDomainDetachDeviceAliasWrapper(virDomainPtr domain,
+ const char *alias,
+ unsigned int flags);
+int virDomainGetLaunchSecurityInfoWrapper(virDomainPtr domain,
+ virTypedParameterPtr *params,
+ int *nparams,
+ unsigned int flags);
+
+#endif /* LIBVIRT_GO_DOMAIN_WRAPPER_H__ */
--
2.17.1