inferGuestTypeFromVolID returns "qemu" or "lxc" based on the vzdump volid prefix.
(volID string)
| 628 | |
| 629 | // inferGuestTypeFromVolID returns "qemu" or "lxc" based on the vzdump volid prefix. |
| 630 | func 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. |
| 643 | func inferContentTypeFromURL(rawURL string) string { |
no outgoing calls