mirror of
https://github.com/containers/podman.git
synced 2025-11-02 14:55:28 +08:00
Fix Lint on Windows and enable the job
[NO NEW TESTS NEEDED] Purely refactoring Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
@ -24,8 +24,8 @@ const (
|
||||
HvsockPurpose = "Purpose"
|
||||
// VsockRegistryPath describes the registry path to where the hvsock registry entries live
|
||||
VsockRegistryPath = `SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\GuestCommunicationServices`
|
||||
// LinuxVm is the default guid for a Linux VM on Windows
|
||||
LinuxVm = "FACB-11E6-BD58-64006A7986D3"
|
||||
// LinuxVM is the default guid for a Linux VM on Windows
|
||||
LinuxVM = "FACB-11E6-BD58-64006A7986D3"
|
||||
)
|
||||
|
||||
// HVSockPurpose describes what the hvsock is needed for
|
||||
@ -141,7 +141,6 @@ func (hv *HVSockRegistryEntry) validate() error {
|
||||
if len(hv.KeyName) < 1 {
|
||||
return errors.New("required field keypath is empty")
|
||||
}
|
||||
//decimal_num, err = strconv.ParseInt(hexadecimal_num, 16, 64)
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -150,7 +149,7 @@ func (hv *HVSockRegistryEntry) exists() (bool, error) {
|
||||
_ = foo
|
||||
_, err := openVSockRegistryEntry(hv.fqPath())
|
||||
if err == nil {
|
||||
return true, err
|
||||
return true, nil
|
||||
}
|
||||
if errors.Is(err, registry.ErrNotExist) {
|
||||
return false, nil
|
||||
@ -191,7 +190,7 @@ func findOpenHVSockPort() (uint64, error) {
|
||||
func NewHVSockRegistryEntry(machineName string, purpose HVSockPurpose) (*HVSockRegistryEntry, error) {
|
||||
// a so-called wildcard entry ... everything from FACB -> 6D3 is MS special sauce
|
||||
// for a " linux vm". this first segment is hexi for the hvsock port number
|
||||
//00000400-FACB-11E6-BD58-64006A7986D3
|
||||
// 00000400-FACB-11E6-BD58-64006A7986D3
|
||||
port, err := findOpenHVSockPort()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -212,7 +211,7 @@ func portToKeyName(port uint64) string {
|
||||
// this could be flattened but given the complexity, I thought it might
|
||||
// be more difficult to read
|
||||
hexi := strings.ToUpper(fmt.Sprintf("%08x", port))
|
||||
return fmt.Sprintf("%s-%s", hexi, LinuxVm)
|
||||
return fmt.Sprintf("%s-%s", hexi, LinuxVM)
|
||||
}
|
||||
|
||||
func LoadHVSockRegistryEntry(port uint64) (*HVSockRegistryEntry, error) {
|
||||
|
||||
Reference in New Issue
Block a user