-
Notifications
You must be signed in to change notification settings - Fork 612
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
refactor: vz disk conversion #1463
Conversation
pkg/qemu/imgutil/imgutil.go
Outdated
cmd.Args, stdout.String(), stderr.String(), err) | ||
} | ||
return nil | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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]>
d4ee80f
to
fd0ab46
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Closes: #1438
Refactored disk conversion functions to be more explicit and used new
imgutil.ConvertToRaw
function in VZ driver, like suggested in #1405 (comment).