Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: vz disk conversion #1463

Merged
merged 1 commit into from
Apr 8, 2023

Conversation

pendo324
Copy link
Contributor

@pendo324 pendo324 commented Apr 6, 2023

Closes: #1438

Refactored disk conversion functions to be more explicit and used new imgutil.ConvertToRaw function in VZ driver, like suggested in #1405 (comment).

cmd.Args, stdout.String(), stderr.String(), err)
}
return nil
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we still need this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you mention it, we probably don't. It's only useful if we want to explicitly specify that the input is qcow2, but qemu-img should be able to detect that on its own. Updated in latest rev.

if err = imgutil.QCOWToRaw(extraDiskPath, rawPath); err != nil {
return fmt.Errorf("failed to convert qcow2 disk %q to raw for vz driver: %w", diskName, err)
oldFormatPath := fmt.Sprintf("%s.%s", extraDiskPath, extraDiskFormat)
if err = imgutil.ConvertToRaw(extraDiskPath, rawPath); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure that extraDiskFormat does not contain os.PathSeparator

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated in latest rev

Signed-off-by: Justin Alvarez <[email protected]>
@pendo324 pendo324 force-pushed the refactor-vz-disk-conversion branch from d4ee80f to fd0ab46 Compare April 7, 2023 21:58
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda added this to the v0.15.1 milestone Apr 8, 2023
@AkihiroSuda AkihiroSuda merged commit f35b3f1 into lima-vm:master Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make disk conversion more generic when using vmType: vz
2 participants