mirror of https://github.com/containers/podman.git
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:
parent
9f0032d3fd
commit
2861bc3702
|
@ -5,8 +5,6 @@ package qemu
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/containers/podman/v5/pkg/machine"
|
"github.com/containers/podman/v5/pkg/machine"
|
||||||
)
|
)
|
||||||
|
@ -27,29 +25,6 @@ func checkProcessStatus(processHint string, pid int, stderrBuf *bytes.Buffer) er
|
||||||
return nil
|
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 {
|
func sigKill(pid int) error {
|
||||||
return nil
|
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
|
|
||||||
}
|
|
Loading…
Reference in New Issue