forked from rgbkrk/libvirt-go
-
Notifications
You must be signed in to change notification settings - Fork 3
/
cfuncs.go
109 lines (92 loc) · 4.04 KB
/
cfuncs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package libvirt
/*
* Golang 1.6 doesn't support C pointers to go memory.
* A hacky-solution might be some multi-threaded approach to support domain events, but let's make it work
* without domain events for now.
*/
/*
#cgo LDFLAGS: -lvirt
#include <libvirt/libvirt.h>
#include <libvirt/virterror.h>
#include <stdlib.h>
int domainEventLifecycleCallback_cgo(virConnectPtr c, virDomainPtr d,
int event, int detail, void *data)
{
return domainEventLifecycleCallback(c, d, event, detail, data);
}
int domainEventGenericCallback_cgo(virConnectPtr c, virDomainPtr d, void *data)
{
return domainEventGenericCallback(c, d, data);
}
int domainEventRTCChangeCallback_cgo(virConnectPtr c, virDomainPtr d,
long long utcoffset, void *data)
{
return domainEventRTCChangeCallback(c, d, utcoffset, data);
}
int domainEventWatchdogCallback_cgo(virConnectPtr c, virDomainPtr d,
int action, void *data)
{
return domainEventWatchdogCallback(c, d, action, data);
}
int domainEventIOErrorCallback_cgo(virConnectPtr c, virDomainPtr d,
const char *srcPath, const char *devAlias,
int action, void *data)
{
return domainEventIOErrorCallback(c, d, srcPath, devAlias, action, data);
}
int domainEventGraphicsCallback_cgo(virConnectPtr c, virDomainPtr d,
int phase, const virDomainEventGraphicsAddress *local,
const virDomainEventGraphicsAddress *remote,
const char *authScheme,
const virDomainEventGraphicsSubject *subject, void *data)
{
return domainEventGraphicsCallback(c, d, phase, local, remote, authScheme, subject, data);
}
int domainEventIOErrorReasonCallback_cgo(virConnectPtr c, virDomainPtr d,
const char *srcPath, const char *devAlias,
int action, const char *reason, void *data)
{
return domainEventIOErrorReasonCallback(c, d, srcPath, devAlias, action, reason, data);
}
int domainEventBlockJobCallback_cgo(virConnectPtr c, virDomainPtr d,
const char *disk, int type, int status, void *data)
{
return domainEventIOErrorReasonCallback(c, d, disk, type, status, data);
}
int domainEventDiskChangeCallback_cgo(virConnectPtr c, virDomainPtr d,
const char *oldSrcPath, const char *newSrcPath,
const char *devAlias, int reason, void *data)
{
return domainEventDiskChangeCallback(c, d, oldSrcPath, newSrcPath, devAlias, reason, data);
}
int domainEventTrayChangeCallback_cgo(virConnectPtr c, virDomainPtr d,
const char *devAlias, int reason, void *data)
{
return domainEventTrayChangeCallback(c, d, devAlias, reason, data);
}
int domainEventReasonCallback_cgo(virConnectPtr c, virDomainPtr d,
int reason, void *data)
{
return domainEventReasonCallback(c, d, reason, data);
}
int domainEventBalloonChangeCallback_cgo(virConnectPtr c, virDomainPtr d,
unsigned long long actual, void *data)
{
return domainEventBalloonChangeCallback(c, d, actual, data);
}
int domainEventDeviceRemovedCallback_cgo(virConnectPtr c, virDomainPtr d,
const char *devAlias, void *data)
{
return domainEventDeviceRemovedCallback(c, d, devAlias, data);
}
void freeGoCallback_cgo(void* goCallbackId) {
freeCallbackId((size_t)goCallbackId);
}
int virConnectDomainEventRegisterAny_cgo(virConnectPtr c, virDomainPtr d,
int eventID, virConnectDomainEventGenericCallback cb,
int goCallbackId) {
void* id = (void*)0 + goCallbackId; // Hack to silence the warning
return virConnectDomainEventRegisterAny(c, d, eventID, cb, id, freeGoCallback_cgo);
}
*/
import "C"