2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2025-12-14 15:03:12 +00:00

fix vhd format support

closes  #47

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2024-05-08 16:48:38 +02:00
committed by Adphi
parent b27add5767
commit f711f8919d
3 changed files with 6 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ ff02::3 ip6-allhosts
perm os.FileMode = 0644
)
var formats = []string{"qcow2", "qed", "raw", "vdi", "vhd", "vmdk"}
var formats = []string{"qcow2", "qed", "raw", "vdi", "vhd", "vhd", "vhdx", "vmdk"}
type Builder interface {
Build(ctx context.Context) (err error)
@@ -113,6 +113,9 @@ func NewBuilder(ctx context.Context, workdir, imgTag, disk string, size uint64,
if !valid {
return nil, fmt.Errorf("invalid format: %s valid formats are: %s", f, strings.Join(formats, " "))
}
if f == "vhd" {
f = "vpc"
}
if splitBoot && bootSize < 50 {
return nil, fmt.Errorf("boot partition size must be at least 50MiB")