Now we only have one variant of this method it can loose the suffix Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx> --- connect.go | 20 ++++++++++---------- domain.go | 26 +++++++++++++------------- domain_events.go | 10 +++++----- typedparams.go | 2 +- typedparams_test.go | 2 +- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/connect.go b/connect.go index f627e7d..f77d10d 100644 --- a/connect.go +++ b/connect.go @@ -1912,7 +1912,7 @@ func (c *Connect) GetMemoryParameters(flags uint32) (*NodeMemoryParameters, erro return nil, makeError(&err) } - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } @@ -2797,7 +2797,7 @@ func (c *Connect) GetAllDomainStats(doms []*Domain, statsTypes DomainStatsTypes, state := &DomainStatsState{} stateInfo := getDomainStatsStateFieldInfo(state) - count, gerr := typedParamsUnpackLen(cdomstats.params, cdomstats.nparams, stateInfo) + count, gerr := typedParamsUnpack(cdomstats.params, cdomstats.nparams, stateInfo) if gerr != nil { return []DomainStats{}, gerr } @@ -2808,7 +2808,7 @@ func (c *Connect) GetAllDomainStats(doms []*Domain, statsTypes DomainStatsTypes, cpu := &DomainStatsCPU{} cpuInfo := getDomainStatsCPUFieldInfo(cpu) - count, gerr = typedParamsUnpackLen(cdomstats.params, cdomstats.nparams, cpuInfo) + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, cpuInfo) if gerr != nil { return []DomainStats{}, gerr } @@ -2819,7 +2819,7 @@ func (c *Connect) GetAllDomainStats(doms []*Domain, statsTypes DomainStatsTypes, balloon := &DomainStatsBalloon{} balloonInfo := getDomainStatsBalloonFieldInfo(balloon) - count, gerr = typedParamsUnpackLen(cdomstats.params, cdomstats.nparams, balloonInfo) + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, balloonInfo) if gerr != nil { return []DomainStats{}, gerr } @@ -2830,7 +2830,7 @@ func (c *Connect) GetAllDomainStats(doms []*Domain, statsTypes DomainStatsTypes, perf := &DomainStatsPerf{} perfInfo := getDomainStatsPerfFieldInfo(perf) - count, gerr = typedParamsUnpackLen(cdomstats.params, cdomstats.nparams, perfInfo) + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, perfInfo) if gerr != nil { return []DomainStats{}, gerr } @@ -2841,7 +2841,7 @@ func (c *Connect) GetAllDomainStats(doms []*Domain, statsTypes DomainStatsTypes, lengths := domainStatsLengths{} lengthsInfo := getDomainStatsLengthsFieldInfo(&lengths) - count, gerr = typedParamsUnpackLen(cdomstats.params, cdomstats.nparams, lengthsInfo) + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, lengthsInfo) if gerr != nil { return []DomainStats{}, gerr } @@ -2857,7 +2857,7 @@ func (c *Connect) GetAllDomainStats(doms []*Domain, statsTypes DomainStatsTypes, vcpu := DomainStatsVcpu{} vcpuInfo := getDomainStatsVcpuFieldInfo(j, &vcpu) - count, gerr = typedParamsUnpackLen(cdomstats.params, cdomstats.nparams, vcpuInfo) + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, vcpuInfo) if gerr != nil { return []DomainStats{}, gerr } @@ -2875,7 +2875,7 @@ func (c *Connect) GetAllDomainStats(doms []*Domain, statsTypes DomainStatsTypes, block := DomainStatsBlock{} blockInfo := getDomainStatsBlockFieldInfo(j, &block) - count, gerr = typedParamsUnpackLen(cdomstats.params, cdomstats.nparams, blockInfo) + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, blockInfo) if gerr != nil { return []DomainStats{}, gerr } @@ -2891,7 +2891,7 @@ func (c *Connect) GetAllDomainStats(doms []*Domain, statsTypes DomainStatsTypes, net := DomainStatsNet{} netInfo := getDomainStatsNetFieldInfo(j, &net) - count, gerr = typedParamsUnpackLen(cdomstats.params, cdomstats.nparams, netInfo) + count, gerr = typedParamsUnpack(cdomstats.params, cdomstats.nparams, netInfo) if gerr != nil { return []DomainStats{}, gerr } @@ -2963,7 +2963,7 @@ func (c *Connect) GetSEVInfo(flags uint32) (*NodeSEVParameters, error) { defer C.virTypedParamsFree(cparams, cnparams) - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } diff --git a/domain.go b/domain.go index bee779f..98dd290 100644 --- a/domain.go +++ b/domain.go @@ -1195,7 +1195,7 @@ func (d *Domain) GetCPUStats(startCpu int, nCpus uint, flags uint32) ([]DomainCP var cparamscpu *C.virTypedParameter cparamscpu = (*C.virTypedParameter)(unsafe.Pointer(uintptr(unsafe.Pointer(cparams)) + (unsafe.Sizeof(*cparams) * uintptr(coffset)))) - _, gerr := typedParamsUnpackLen(cparamscpu, cnparams, info) + _, gerr := typedParamsUnpack(cparamscpu, cnparams, info) if gerr != nil { return []DomainCPUStats{}, gerr } @@ -1275,7 +1275,7 @@ func (d *Domain) GetInterfaceParameters(device string, flags DomainModificationI return nil, makeError(&err) } - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } @@ -1665,7 +1665,7 @@ func (d *Domain) BlockStatsFlags(disk string, flags uint32) (*DomainBlockStats, return nil, makeError(&err) } - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } @@ -2609,7 +2609,7 @@ func (d *Domain) GetBlkioParameters(flags DomainModificationImpact) (*DomainBlki return nil, makeError(&err) } - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } @@ -2787,7 +2787,7 @@ func (d *Domain) GetBlockIoTune(disk string, flags DomainModificationImpact) (*D return nil, makeError(&err) } - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } @@ -3165,7 +3165,7 @@ func (d *Domain) GetJobStats(flags DomainGetJobStatsFlags) (*DomainJobInfo, erro params := DomainJobInfo{} info := getDomainJobInfoFieldInfo(¶ms) - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } @@ -3259,7 +3259,7 @@ func (d *Domain) GetMemoryParameters(flags DomainModificationImpact) (*DomainMem return nil, makeError(&err) } - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } @@ -3326,7 +3326,7 @@ func (d *Domain) GetNumaParameters(flags DomainModificationImpact) (*DomainNumaP return nil, makeError(&err) } - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } @@ -3515,7 +3515,7 @@ func (d *Domain) GetPerfEvents(flags DomainModificationImpact) (*DomainPerfEvent defer C.virTypedParamsFree(cparams, cnparams) - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } @@ -3665,7 +3665,7 @@ func (d *Domain) GetSchedulerParameters() (*DomainSchedulerParameters, error) { return nil, makeError(&err) } - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } @@ -3699,7 +3699,7 @@ func (d *Domain) GetSchedulerParametersFlags(flags DomainModificationImpact) (*D return nil, makeError(&err) } - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } @@ -4534,7 +4534,7 @@ func (d *Domain) GetGuestVcpus(flags uint32) (*DomainGuestVcpus, error) { defer C.virTypedParamsFree(cparams, C.int(cnparams)) - _, gerr := typedParamsUnpackLen(cparams, C.int(cnparams), info) + _, gerr := typedParamsUnpack(cparams, C.int(cnparams), info) if gerr != nil { return nil, gerr } @@ -4751,7 +4751,7 @@ func (d *Domain) GetLaunchSecurityInfo(flags uint32) (*DomainLaunchSecurityParam defer C.virTypedParamsFree(cparams, cnparams) - _, gerr := typedParamsUnpackLen(cparams, cnparams, info) + _, gerr := typedParamsUnpack(cparams, cnparams, info) if gerr != nil { return nil, gerr } diff --git a/domain_events.go b/domain_events.go index 7e72313..2aff8e8 100644 --- a/domain_events.go +++ b/domain_events.go @@ -763,7 +763,7 @@ func domainEventTunableGetPin(params C.virTypedParameterPtr, cnparams C.int) *Do numvcpus, numiothreads := countPinInfo(params, cnparams) pinInfo := getDomainPinTempFieldInfo(numvcpus, numiothreads, &pin) - num, err := typedParamsUnpackLen(params, cnparams, pinInfo) + num, err := typedParamsUnpack(params, cnparams, pinInfo) if num == 0 || err != nil { return nil } @@ -820,7 +820,7 @@ func domainEventTunableCallback(c C.virConnectPtr, d C.virDomainPtr, params C.vi var sched DomainSchedulerParameters schedInfo := getDomainTuneSchedulerParametersFieldInfo(&sched) - num, _ := typedParamsUnpackLen(params, cnparams, schedInfo) + num, _ := typedParamsUnpack(params, cnparams, schedInfo) if num > 0 { eventDetails.CpuSched = &sched } @@ -831,12 +831,12 @@ func domainEventTunableCallback(c C.virConnectPtr, d C.virDomainPtr, params C.vi s: &eventDetails.BlkdevDisk, }, } - typedParamsUnpackLen(params, cnparams, blknameInfo) + typedParamsUnpack(params, cnparams, blknameInfo) var blktune DomainBlockIoTuneParameters blktuneInfo := getTuneBlockIoTuneParametersFieldInfo(&blktune) - num, _ = typedParamsUnpackLen(params, cnparams, blktuneInfo) + num, _ = typedParamsUnpack(params, cnparams, blktuneInfo) if num > 0 { eventDetails.BlkdevTune = &blktune } @@ -910,7 +910,7 @@ func domainEventJobCompletedCallback(c C.virConnectPtr, d C.virDomainPtr, params eventDetails := &DomainEventJobCompleted{} info := getDomainJobInfoFieldInfo(&eventDetails.Info) - typedParamsUnpackLen(params, cnparams, info) + typedParamsUnpack(params, cnparams, info) callbackFunc := getCallbackId(goCallbackId) callback, ok := callbackFunc.(DomainEventJobCompletedCallback) diff --git a/typedparams.go b/typedparams.go index 0a4c175..ccceee1 100644 --- a/typedparams.go +++ b/typedparams.go @@ -53,7 +53,7 @@ type typedParamsFieldInfo struct { sl *[]string } -func typedParamsUnpackLen(cparams *C.virTypedParameter, cnparams C.int, infomap map[string]typedParamsFieldInfo) (uint, error) { +func typedParamsUnpack(cparams *C.virTypedParameter, cnparams C.int, infomap map[string]typedParamsFieldInfo) (uint, error) { count := uint(0) for name, value := range infomap { var err C.virError diff --git a/typedparams_test.go b/typedparams_test.go index dca65b2..7720bcd 100644 --- a/typedparams_test.go +++ b/typedparams_test.go @@ -86,7 +86,7 @@ func TestPackUnpack(t *testing.T) { t.Fatal(err) } - nout, err := typedParamsUnpackLen(params, nparams, infoout) + nout, err := typedParamsUnpack(params, nparams, infoout) if err != nil { t.Fatal(err) } -- 2.20.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list