From 52112fc5c11c161692018eb4a4e84a58b6ae3499 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 13 Oct 2023 03:19:39 +0000 Subject: [PATCH] fix(deps): update github.com/containers/libhvee digest to e51be96 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 +-- .../containers/libhvee/pkg/hypervctl/vm.go | 5 --- .../libhvee/pkg/hypervctl/vm_config.go | 6 ++-- .../containers/libhvee/pkg/wmiext/enum.go | 2 +- .../containers/libhvee/pkg/wmiext/init.go | 2 +- .../containers/libhvee/pkg/wmiext/instance.go | 34 +++++++++++++++---- .../containers/libhvee/pkg/wmiext/invoke.go | 9 ++++- .../containers/libhvee/pkg/wmiext/service.go | 6 ++-- vendor/modules.txt | 2 +- 10 files changed, 48 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index 31c03ddaf4..ee1ae7ba12 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/containers/conmon v2.0.20+incompatible github.com/containers/gvisor-tap-vsock v0.7.1 github.com/containers/image/v5 v5.28.0 - github.com/containers/libhvee v0.4.1-0.20231005205143-fcf1cc2543b3 + github.com/containers/libhvee v0.4.1-0.20231012183749-e51be96b4854 github.com/containers/ocicrypt v1.1.8 github.com/containers/psgo v1.8.0 github.com/containers/storage v1.50.3-0.20231005200628-e21971a94abb diff --git a/go.sum b/go.sum index 6dc8a88fa7..748c7b4c57 100644 --- a/go.sum +++ b/go.sum @@ -259,8 +259,8 @@ github.com/containers/gvisor-tap-vsock v0.7.1 h1:+Rc+sOPplrkQb/BUXeN0ug8TxjgyrIq github.com/containers/gvisor-tap-vsock v0.7.1/go.mod h1:WSSsjcuYZkvP8i0J+Ht3LF8yvysn3krD5zxQ74wz7y0= github.com/containers/image/v5 v5.28.0 h1:H4cWbdI88UA/mDb6SxMo3IxpmS1BSs/Kifvhwt9g048= github.com/containers/image/v5 v5.28.0/go.mod h1:9aPnNkwHNHgGl9VlQxXEshvmOJRbdRAc1rNDD6sP2eU= -github.com/containers/libhvee v0.4.1-0.20231005205143-fcf1cc2543b3 h1:p0nglHRdtdrpPYyavMqf+Eqp4PkZNBAUWC0OuTjiXcE= -github.com/containers/libhvee v0.4.1-0.20231005205143-fcf1cc2543b3/go.mod h1:3lTcwI2g7qe8Ekgk9hdDxQeT9KrqXPilQvxJfIJp8TQ= +github.com/containers/libhvee v0.4.1-0.20231012183749-e51be96b4854 h1:9pHtBDAO1ZE0Cwhn3rfp7CfqpfeaYllG2o6wuDdxsa8= +github.com/containers/libhvee v0.4.1-0.20231012183749-e51be96b4854/go.mod h1:3lTcwI2g7qe8Ekgk9hdDxQeT9KrqXPilQvxJfIJp8TQ= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYglewc+UyGf6lc8Mj2UaPTHy/iF2De0/77CA= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY= github.com/containers/luksy v0.0.0-20230808154129-d2d74a56682f h1:/HjLNYkVoUJNT4mm2dzGl63x7nD6YHxxI/k1kR0TkzA= diff --git a/vendor/github.com/containers/libhvee/pkg/hypervctl/vm.go b/vendor/github.com/containers/libhvee/pkg/hypervctl/vm.go index 944ae2b91c..e610990d0f 100644 --- a/vendor/github.com/containers/libhvee/pkg/hypervctl/vm.go +++ b/vendor/github.com/containers/libhvee/pkg/hypervctl/vm.go @@ -306,11 +306,6 @@ func getService(_ *wmiext.Service) (*wmiext.Service, error) { return wmiext.NewLocalService(HyperVNamespace) } -func (vm *VirtualMachine) list() ([]*HyperVConfig, error) { - - return nil, ErrNotImplemented -} - func (vm *VirtualMachine) GetConfig(diskPath string) (*HyperVConfig, error) { var ( diskSize uint64 diff --git a/vendor/github.com/containers/libhvee/pkg/hypervctl/vm_config.go b/vendor/github.com/containers/libhvee/pkg/hypervctl/vm_config.go index 82740c578e..4ea14d660a 100644 --- a/vendor/github.com/containers/libhvee/pkg/hypervctl/vm_config.go +++ b/vendor/github.com/containers/libhvee/pkg/hypervctl/vm_config.go @@ -14,12 +14,12 @@ const ( start vmState = 2 // Stops the job temporarily. The intention is to subsequently restart the job with 'Start'. It might be possible to // enter the 'Service' state while suspended. (This is job-specific.) - suspend vmState = 3 + suspend vmState = 3 //nolint: unused // Stops the job cleanly, saves data, preserves the state, and shuts down all underlying processes' // in an orderly manner. - terminate vmState = 4 + terminate vmState = 4 //nolint: unused //Terminates the job immediately with no requirement to save data or preserve the state. - kill vmState = 5 + kill vmState = 5 //nolint: unused ) type EnabledState uint16 diff --git a/vendor/github.com/containers/libhvee/pkg/wmiext/enum.go b/vendor/github.com/containers/libhvee/pkg/wmiext/enum.go index 7f1f562198..7bb4d8d019 100644 --- a/vendor/github.com/containers/libhvee/pkg/wmiext/enum.go +++ b/vendor/github.com/containers/libhvee/pkg/wmiext/enum.go @@ -76,7 +76,7 @@ func (e *Enum) Next() (instance *Instance, err error) { uintptr(1), // [in] ULONG uCount, uintptr(unsafe.Pointer(&apObjects)), // [out] IWbemClassObject **apObjects, uintptr(unsafe.Pointer(&uReturned))) // [out] ULONG *puReturned) - if res < 0 { + if int(res) < 0 { return nil, ole.NewError(res) } diff --git a/vendor/github.com/containers/libhvee/pkg/wmiext/init.go b/vendor/github.com/containers/libhvee/pkg/wmiext/init.go index 03ca4f585f..5951733622 100644 --- a/vendor/github.com/containers/libhvee/pkg/wmiext/init.go +++ b/vendor/github.com/containers/libhvee/pkg/wmiext/init.go @@ -107,7 +107,7 @@ func initSecurity() { uintptr(0), // [in, optional] void *pAuthList, uintptr(EOAC_NONE), // [in] DWORD dwCapabilities, uintptr(0)) // [in, optional] void *pReserved3 - if res < 0 { + if int(res) < 0 { logrus.Errorf("Unable to initialize COM security: %s", ole.NewError(res).Error()) } } diff --git a/vendor/github.com/containers/libhvee/pkg/wmiext/instance.go b/vendor/github.com/containers/libhvee/pkg/wmiext/instance.go index 8aece77aea..64fe257b4c 100644 --- a/vendor/github.com/containers/libhvee/pkg/wmiext/instance.go +++ b/vendor/github.com/containers/libhvee/pkg/wmiext/instance.go @@ -14,6 +14,7 @@ import ( "unsafe" "github.com/go-ole/go-ole" + "github.com/sirupsen/logrus" ) const ( @@ -353,7 +354,12 @@ func (i *Instance) GetAsAny(name string) (interface{}, CIMTYPE_ENUMERATION, WBEM if err != nil { return nil, cimType, flavor, err } - defer variant.Clear() + + defer func() { + if err := variant.Clear(); err != nil { + logrus.Error(err) + } + }() // Since there is no type information only perform the stock conversion result := convertToGenericValue(variant) @@ -367,7 +373,11 @@ func (i *Instance) GetAsString(name string) (value string, err error) { if err != nil || variant == nil { return "", err } - defer variant.Clear() + defer func() { + if err := variant.Clear(); err != nil { + logrus.Error(err) + } + }() // TODO: replace with something better return fmt.Sprintf("%v", convertToGenericValue(variant)), nil @@ -449,7 +459,11 @@ func (i *Instance) Next() (done bool, name string, value interface{}, cimType CI done, name, variant, cimType, flavor, err = i.NextAsVariant() if err == nil && !done { - defer variant.Clear() + defer func() { + if err := variant.Clear(); err != nil { + logrus.Error(err) + } + }() value = convertToGenericValue(variant) } @@ -475,7 +489,7 @@ func (i *Instance) NextAsVariant() (bool, string, *ole.VARIANT, CIMTYPE_ENUMERAT uintptr(unsafe.Pointer(&variant)), // [out] VARIANT *pVal, uintptr(unsafe.Pointer(&cimType)), // [out, optional] CIMTYPE *pType, uintptr(unsafe.Pointer(&flavor))) // [out, optional] long *plFlavor - if res < 0 { + if int(res) < 0 { return false, "", nil, cimType, flavor, ole.NewError(res) } @@ -483,7 +497,11 @@ func (i *Instance) NextAsVariant() (bool, string, *ole.VARIANT, CIMTYPE_ENUMERAT return true, "", nil, cimType, flavor, nil } - defer ole.SysFreeString((*int16)(unsafe.Pointer(strName))) + defer func() { + if err := ole.SysFreeString((*int16)(unsafe.Pointer(strName))); err != nil { + logrus.Error(err) + } + }() name := ole.BstrToString(strName) return false, name, &variant, cimType, flavor, nil @@ -501,7 +519,11 @@ func (i *Instance) GetAllProperties() (map[string]interface{}, error) { return nil, err } - defer i.EndEnumeration() + defer func() { + if err := i.EndEnumeration(); err != nil { + logrus.Error(err) + } + }() for { var name string diff --git a/vendor/github.com/containers/libhvee/pkg/wmiext/invoke.go b/vendor/github.com/containers/libhvee/pkg/wmiext/invoke.go index 8f7f36f66b..6875e2de69 100644 --- a/vendor/github.com/containers/libhvee/pkg/wmiext/invoke.go +++ b/vendor/github.com/containers/libhvee/pkg/wmiext/invoke.go @@ -8,6 +8,7 @@ import ( "reflect" "github.com/go-ole/go-ole" + "github.com/sirupsen/logrus" ) type MethodExecutor struct { @@ -61,7 +62,13 @@ func (e *MethodExecutor) Out(name string, value interface{}) *MethodExecutor { if e.err != nil || variant == nil { return e } - defer variant.Clear() + + defer func() { + if err := variant.Clear(); err != nil { + logrus.Error(err) + } + }() + if _, ok := value.(**Instance); ok && cimType == CIM_REFERENCE { path := variant.ToString() result, e.err = e.service.GetObject(path) diff --git a/vendor/github.com/containers/libhvee/pkg/wmiext/service.go b/vendor/github.com/containers/libhvee/pkg/wmiext/service.go index 190d83acfb..8824268489 100644 --- a/vendor/github.com/containers/libhvee/pkg/wmiext/service.go +++ b/vendor/github.com/containers/libhvee/pkg/wmiext/service.go @@ -199,7 +199,7 @@ func (s *Service) GetObject(objectPath string) (instance *Instance, err error) { uintptr(0), // [in] IWbemContext *pCtx, uintptr(unsafe.Pointer(&pObject)), // [out] IWbemClassObject **ppObject, uintptr(0)) // [out] IWbemCallResult **ppCallResult) - if res < 0 { + if int(res) < 0 { // returns WBEM_E_PROVIDER_NOT_FOUND when no entry found return nil, ole.NewError(res) } @@ -239,7 +239,7 @@ func (s *Service) CreateInstanceEnum(className string) (*Enum, error) { uintptr(flags), // [in] long lFlags, uintptr(0), // [in] IWbemContext *pCtx, uintptr(unsafe.Pointer(&pEnum))) // [out] IEnumWbemClassObject **ppEnum) - if res < 0 { + if int(res) < 0 { return nil, ole.NewError(res) } @@ -277,7 +277,7 @@ func (s *Service) ExecMethod(className string, methodName string, inParams *Inst uintptr(unsafe.Pointer(inParams.object)), // [in] IWbemClassObject *pInParams, uintptr(unsafe.Pointer(&outParams)), // [out] IWbemClassObject **ppOutParams, uintptr(0)) // [out] IWbemCallResult **ppCallResult) - if res < 0 { + if int(res) < 0 { return nil, ole.NewError(res) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 8d8556233e..5384dd78e2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -304,7 +304,7 @@ github.com/containers/image/v5/transports github.com/containers/image/v5/transports/alltransports github.com/containers/image/v5/types github.com/containers/image/v5/version -# github.com/containers/libhvee v0.4.1-0.20231005205143-fcf1cc2543b3 +# github.com/containers/libhvee v0.4.1-0.20231012183749-e51be96b4854 ## explicit; go 1.18 github.com/containers/libhvee/pkg/hypervctl github.com/containers/libhvee/pkg/kvp/ginsu