Skip to content

Commit 0bf791e

Browse files
authored
fix(migrate): cannot launch when migrated (#94)
Signed-off-by: Kevin Cui <bh@bugs.cc>
1 parent b8fae83 commit 0bf791e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/update/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (c *Context) updateData() error {
7272
return fmt.Errorf("failed to remove old data: %w", err)
7373
}
7474

75-
dataSize := util.DataSize(c.Name + c.ImageDir)
75+
dataSize := util.DataSize(c.Name)
7676
log.Infof("Creating new data: %s, size: %d", dataPath, dataSize)
7777
if err := vhdx.Create(dataPath, dataSize); err != nil {
7878
return fmt.Errorf("failed to create new data: %w", err)

pkg/wsl/distro.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func launchOVMD(ctx context.Context, opt *types.RunOpt) error {
211211
return fmt.Errorf("could not create vm logger: %w", err)
212212
}
213213

214-
dataSector := util.DataSize(opt.Name+opt.ImageDir) / 512
214+
dataSector := util.DataSize(opt.Name) / 512
215215
// See: https://github.com/oomol-lab/ovm-builder/blob/main/scripts/ovmd
216216
cmd := util.SilentCmdContext(ctx, Find(),
217217
"-d", opt.DistroName,

0 commit comments

Comments
 (0)