fix(deps): update github.com/containers/libhvee digest to e51be96

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2023-10-13 03:19:39 +00:00
committed by GitHub
parent 5afa949a43
commit 52112fc5c1
10 changed files with 48 additions and 24 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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)
}

View File

@@ -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())
}
}

View File

@@ -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

View File

@@ -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)

View File

@@ -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)
}