MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / inferGuestTypeFromVolID

Function inferGuestTypeFromVolID

internal/cli/cli_helpers.go:630–640  ·  view source on GitHub ↗

inferGuestTypeFromVolID returns "qemu" or "lxc" based on the vzdump volid prefix.

(volID string)

Source from the content-addressed store, hash-verified

628
629// inferGuestTypeFromVolID returns "qemu" or "lxc" based on the vzdump volid prefix.
630func inferGuestTypeFromVolID(volID string) (string, error) {
631 lower := strings.ToLower(volID)
632 switch {
633 case strings.Contains(lower, "vzdump-qemu-"):
634 return "qemu", nil
635 case strings.Contains(lower, "vzdump-lxc-"):
636 return "lxc", nil
637 default:
638 return "", fmt.Errorf("cannot infer guest type from volid %q — use --type qemu|lxc", volID)
639 }
640}
641
642// inferContentTypeFromURL guesses a Proxmox content type from a URL's filename extension.
643func inferContentTypeFromURL(rawURL string) string {

Callers 2

runStorageRestoreFunction · 0.85

Calls

no outgoing calls

Tested by 1