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:
Kir Kolyshkin
2025-03-29 22:10:46 -07:00
parent 9f0032d3fd
commit 2861bc3702
3 changed files with 0 additions and 63 deletions

View File

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

View File

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

View File

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