diff options
author | Tomofumi Hayashi <tohayash@redhat.com> | 2019-04-27 20:38:39 +0900 |
---|---|---|
committer | Tomofumi Hayashi <tohayash@redhat.com> | 2019-04-27 20:40:37 +0900 |
commit | 4d11ca17d0f73f5bd783f45900118295fdfed46b (patch) | |
tree | cce8575b02ac850d2b30ec12a5c4083c48e85c6c /src/dma/vendor/github.com/libvirt | |
parent | 07e4a96e4996f3d39b92dd601b3ed0d23bfbaa0c (diff) |
barometer: update DMA's vendoring packages
Change-Id: I0578b094f1ecdaed20c906be2ba29d51b8089d7c
Signed-off-by: Tomofumi Hayashi <tohayash@redhat.com>
Diffstat (limited to 'src/dma/vendor/github.com/libvirt')
4 files changed, 104 insertions, 1 deletions
diff --git a/src/dma/vendor/github.com/libvirt/libvirt-go/domain.go b/src/dma/vendor/github.com/libvirt/libvirt-go/domain.go index 3a3ef5b7..8c3960cc 100644 --- a/src/dma/vendor/github.com/libvirt/libvirt-go/domain.go +++ b/src/dma/vendor/github.com/libvirt/libvirt-go/domain.go @@ -593,6 +593,7 @@ const ( DOMAIN_SHUTOFF_SAVED = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_SAVED) DOMAIN_SHUTOFF_FAILED = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_FAILED) DOMAIN_SHUTOFF_FROM_SNAPSHOT = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT) + DOMAIN_SHUTOFF_DAEMON = DomainShutoffReason(C.VIR_DOMAIN_SHUTOFF_DAEMON) ) type DomainBlockCommitFlags int @@ -768,6 +769,7 @@ const ( DOMAIN_STATS_INTERFACE = DomainStatsTypes(C.VIR_DOMAIN_STATS_INTERFACE) DOMAIN_STATS_BLOCK = DomainStatsTypes(C.VIR_DOMAIN_STATS_BLOCK) DOMAIN_STATS_PERF = DomainStatsTypes(C.VIR_DOMAIN_STATS_PERF) + DOMAIN_STATS_IOTHREAD = DomainStatsTypes(C.VIR_DOMAIN_STATS_IOTHREAD) ) type DomainCoreDumpFlags int @@ -4206,6 +4208,57 @@ func (d *Domain) DelIOThread(id uint, flags DomainModificationImpact) error { return nil } +// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetIOThreadParams + +type DomainSetIOThreadParams struct { + PollMaxNsSet bool + PollMaxNs uint64 + PollGrowSet bool + PollGrow uint + PollShrinkSet bool + PollShrink uint +} + +func getSetIOThreadParamsFieldInfo(params *DomainSetIOThreadParams) map[string]typedParamsFieldInfo { + return map[string]typedParamsFieldInfo{ + C.VIR_DOMAIN_IOTHREAD_POLL_MAX_NS: typedParamsFieldInfo{ + set: ¶ms.PollMaxNsSet, + ul: ¶ms.PollMaxNs, + }, + C.VIR_DOMAIN_IOTHREAD_POLL_GROW: typedParamsFieldInfo{ + set: ¶ms.PollGrowSet, + ui: ¶ms.PollGrow, + }, + C.VIR_DOMAIN_IOTHREAD_POLL_SHRINK: typedParamsFieldInfo{ + set: ¶ms.PollShrinkSet, + ui: ¶ms.PollShrink, + }, + } +} + +func (d *Domain) SetIOThreadParams(iothreadid uint, params *DomainSetIOThreadParams, flags DomainModificationImpact) error { + if C.LIBVIR_VERSION_NUMBER < 4010000 { + return makeNotImplementedError("virDomainSetIOThreadParams") + } + info := getSetIOThreadParamsFieldInfo(params) + + cparams, gerr := typedParamsPackNew(info) + if gerr != nil { + return gerr + } + nparams := len(*cparams) + + defer C.virTypedParamsClear((*C.virTypedParameter)(unsafe.Pointer(&(*cparams)[0])), C.int(nparams)) + + var err C.virError + ret := C.virDomainSetIOThreadParamsWrapper(d.ptr, C.uint(iothreadid), (*C.virTypedParameter)(unsafe.Pointer(&(*cparams)[0])), C.int(nparams), C.uint(flags), &err) + if ret == -1 { + return makeError(&err) + } + + return nil +} + // See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetEmulatorPinInfo func (d *Domain) GetEmulatorPinInfo(flags DomainModificationImpact) ([]bool, error) { var cnodeinfo C.virNodeInfo diff --git a/src/dma/vendor/github.com/libvirt/libvirt-go/domain_compat.h b/src/dma/vendor/github.com/libvirt/libvirt-go/domain_compat.h index d20631fc..19a3e24e 100644 --- a/src/dma/vendor/github.com/libvirt/libvirt-go/domain_compat.h +++ b/src/dma/vendor/github.com/libvirt/libvirt-go/domain_compat.h @@ -895,7 +895,7 @@ struct _virDomainInterface { #endif #ifndef VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP -#define VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP 1 +#define VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP 2 #endif /* 4.5.0 */ @@ -911,4 +911,26 @@ struct _virDomainInterface { #define VIR_DOMAIN_MEMORY_STAT_DISK_CACHES 10 #endif +/* 4.10.0 */ + +#ifndef VIR_DOMAIN_SHUTOFF_DAEMON +#define VIR_DOMAIN_SHUTOFF_DAEMON 8 +#endif + +#ifndef VIR_DOMAIN_STATS_IOTHREAD +#define VIR_DOMAIN_STATS_IOTHREAD (1 << 7) +#endif + +#ifndef VIR_DOMAIN_IOTHREAD_POLL_GROW +#define VIR_DOMAIN_IOTHREAD_POLL_GROW "poll_grow" +#endif + +#ifndef VIR_DOMAIN_IOTHREAD_POLL_SHRINK +#define VIR_DOMAIN_IOTHREAD_POLL_SHRINK "poll_shrink" +#endif + +#ifndef VIR_DOMAIN_IOTHREAD_POLL_MAX_NS +#define VIR_DOMAIN_IOTHREAD_POLL_MAX_NS "poll_max_ns" +#endif + #endif /* LIBVIRT_GO_DOMAIN_COMPAT_H__ */ diff --git a/src/dma/vendor/github.com/libvirt/libvirt-go/domain_wrapper.go b/src/dma/vendor/github.com/libvirt/libvirt-go/domain_wrapper.go index b42dd42f..f674bd51 100644 --- a/src/dma/vendor/github.com/libvirt/libvirt-go/domain_wrapper.go +++ b/src/dma/vendor/github.com/libvirt/libvirt-go/domain_wrapper.go @@ -1914,6 +1914,26 @@ virDomainSetGuestVcpusWrapper(virDomainPtr domain, int +virDomainSetIOThreadParamsWrapper(virDomainPtr domain, + unsigned int iothread_id, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err) +{ +#if LIBVIR_VERSION_NUMBER < 4010000 + assert(0); // Caller should have checked version +#else + int ret = virDomainSetIOThreadParams(domain, iothread_id, params, nparams, flags); + if (ret < 0) { + virCopyLastError(err); + } + return ret; +#endif +} + + +int virDomainSetInterfaceParametersWrapper(virDomainPtr domain, const char *device, virTypedParameterPtr params, diff --git a/src/dma/vendor/github.com/libvirt/libvirt-go/domain_wrapper.h b/src/dma/vendor/github.com/libvirt/libvirt-go/domain_wrapper.h index 7bd82826..48a4cd39 100644 --- a/src/dma/vendor/github.com/libvirt/libvirt-go/domain_wrapper.h +++ b/src/dma/vendor/github.com/libvirt/libvirt-go/domain_wrapper.h @@ -814,6 +814,14 @@ virDomainSetGuestVcpusWrapper(virDomainPtr domain, virErrorPtr err); int +virDomainSetIOThreadParamsWrapper(virDomainPtr domain, + unsigned int iothread_id, + virTypedParameterPtr params, + int nparams, + unsigned int flags, + virErrorPtr err); + +int virDomainSetInterfaceParametersWrapper(virDomainPtr domain, const char *device, virTypedParameterPtr params, |