Commit 832269e8 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Add job operation constants

Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
parent d434c373
......@@ -812,6 +812,20 @@ const (
VCPU_BLOCKED = VcpuState(C.VIR_VCPU_BLOCKED)
)
type DomainJobOperationType int
const (
DOMAIN_JOB_OPERATION_UNKNOWN = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_UNKNOWN)
DOMAIN_JOB_OPERATION_START = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_START)
DOMAIN_JOB_OPERATION_SAVE = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_SAVE)
DOMAIN_JOB_OPERATION_RESTORE = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_RESTORE)
DOMAIN_JOB_OPERATION_MIGRATION_IN = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_MIGRATION_IN)
DOMAIN_JOB_OPERATION_MIGRATION_OUT = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_MIGRATION_OUT)
DOMAIN_JOB_OPERATION_SNAPSHOT = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_SNAPSHOT)
DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT)
DOMAIN_JOB_OPERATION_DUMP = DomainJobOperationType(C.VIR_DOMAIN_JOB_OPERATION_DUMP)
)
type DomainBlockInfo struct {
Capacity uint64
Allocation uint64
......@@ -2760,6 +2774,8 @@ type DomainJobInfo struct {
CompressionOverflow uint64
AutoConvergeThrottleSet bool
AutoConvergeThrottle int
OperationSet bool
Operation DomainJobOperationType
}
func (d *Domain) GetJobInfo() (*DomainJobInfo, error) {
......@@ -2911,6 +2927,10 @@ func getDomainJobInfoFieldInfo(params *DomainJobInfo) map[string]typedParamsFiel
set: &params.AutoConvergeThrottleSet,
i: &params.AutoConvergeThrottle,
},
C.VIR_DOMAIN_JOB_OPERATION: typedParamsFieldInfo{
set: &params.OperationSet,
i: (*int)(&params.Operation),
},
}
}
......
......@@ -898,4 +898,46 @@ int virDomainSetBlockThresholdCompat(virDomainPtr domain,
unsigned long long threshold,
unsigned int flags);
/* 3.3.0 */
#ifndef VIR_DOMAIN_JOB_OPERATION
#define VIR_DOMAIN_JOB_OPERATION "operation"
#endif
#ifndef VIR_DOMAIN_JOB_OPERATION_UNKNOWN
#define VIR_DOMAIN_JOB_OPERATION_UNKNOWN 0
#endif
#ifndef VIR_DOMAIN_JOB_OPERATION_START
#define VIR_DOMAIN_JOB_OPERATION_START 1
#endif
#ifndef VIR_DOMAIN_JOB_OPERATION_SAVE
#define VIR_DOMAIN_JOB_OPERATION_SAVE 2
#endif
#ifndef VIR_DOMAIN_JOB_OPERATION_RESTORE
#define VIR_DOMAIN_JOB_OPERATION_RESTORE 3
#endif
#ifndef VIR_DOMAIN_JOB_OPERATION_MIGRATION_IN
#define VIR_DOMAIN_JOB_OPERATION_MIGRATION_IN 4
#endif
#ifndef VIR_DOMAIN_JOB_OPERATION_MIGRATION_OUT
#define VIR_DOMAIN_JOB_OPERATION_MIGRATION_OUT 5
#endif
#ifndef VIR_DOMAIN_JOB_OPERATION_SNAPSHOT
#define VIR_DOMAIN_JOB_OPERATION_SNAPSHOT 6
#endif
#ifndef VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT
#define VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT 7
#endif
#ifndef VIR_DOMAIN_JOB_OPERATION_DUMP
#define VIR_DOMAIN_JOB_OPERATION_DUMP 8
#endif
#endif /* LIBVIRT_GO_DOMAIN_COMPAT_H__ */
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