mirror of
https://github.com/containers/podman.git
synced 2025-05-20 08:36:23 +08:00
pkg/machine/qemu: rm unused code
Looks like this is a forgotten part of commit 9bb191df5 ("[CI:MACHINE]Podman5 QEMU refactor"). The reason is, linters for Windows skip pkg/machine/qemu, and linters for freebsd are not run at all. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@ -5,8 +5,6 @@ package qemu
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/containers/podman/v5/pkg/machine"
|
||||
)
|
||||
@ -27,29 +25,6 @@ func checkProcessStatus(processHint string, pid int, stderrBuf *bytes.Buffer) er
|
||||
return nil
|
||||
}
|
||||
|
||||
func pathsFromVolume(volume string) []string {
|
||||
paths := strings.SplitN(volume, ":", 3)
|
||||
driveLetterMatcher := regexp.MustCompile(`^(?:\\\\[.?]\\)?[a-zA-Z]$`)
|
||||
if len(paths) > 1 && driveLetterMatcher.MatchString(paths[0]) {
|
||||
paths = strings.SplitN(volume, ":", 4)
|
||||
paths = append([]string{paths[0] + ":" + paths[1]}, paths[2:]...)
|
||||
}
|
||||
return paths
|
||||
}
|
||||
|
||||
func extractTargetPath(paths []string) string {
|
||||
if len(paths) > 1 {
|
||||
return paths[1]
|
||||
}
|
||||
target := strings.ReplaceAll(paths[0], "\\", "/")
|
||||
target = strings.ReplaceAll(target, ":", "/")
|
||||
if strings.HasPrefix(target, "//./") || strings.HasPrefix(target, "//?/") {
|
||||
target = target[4:]
|
||||
}
|
||||
dedup := regexp.MustCompile(`//+`)
|
||||
return dedup.ReplaceAllLiteralString("/"+target, "/")
|
||||
}
|
||||
|
||||
func sigKill(pid int) error {
|
||||
return nil
|
||||
}
|
||||
|
@ -1,19 +0,0 @@
|
||||
//go:build freebsd
|
||||
|
||||
package qemu
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func getRuntimeDir() (string, error) {
|
||||
tmpDir, ok := os.LookupEnv("TMPDIR")
|
||||
if !ok {
|
||||
tmpDir = "/tmp"
|
||||
}
|
||||
return tmpDir, nil
|
||||
}
|
||||
|
||||
func useNetworkRecover() bool {
|
||||
return false
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
//go:build windows
|
||||
|
||||
package qemu
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func getRuntimeDir() (string, error) {
|
||||
tmpDir, ok := os.LookupEnv("TEMP")
|
||||
if !ok {
|
||||
tmpDir = os.Getenv("LOCALAPPDATA") + "\\Temp"
|
||||
}
|
||||
return tmpDir, nil
|
||||
}
|
||||
|
||||
func useNetworkRecover() bool {
|
||||
return false
|
||||
}
|
Reference in New Issue
Block a user