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

qemu: support '4k' and 'serial' disk options #3242

Merged
merged 2 commits into from
Nov 30, 2022

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Nov 28, 2022

See individual commits.

@@ -107,13 +107,16 @@ func ParseDiskSpec(spec string) (*Disk, error) {
split := strings.Split(spec, ":")
var size string
multipathed := false
sectorSize := 0
Copy link
Contributor

Choose a reason for hiding this comment

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

What about defaulting it at 512?

Copy link
Member Author

Choose a reason for hiding this comment

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

When SectorSize is 0, we just let the default QEMU behaviour kick in, which is 512 logical/physical sector sizes.

Copy link
Member

Choose a reason for hiding this comment

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

(In Rust this would be an Option<u32> which would better express semantics)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see that makes sense! cool thank you.

@dustymabe
Copy link
Member

any chance we could get some documentation for this?

Support for e.g. `cosa run --add-disk 10G:4k`.
Support for e.g. `cosa run --add-disk 10G:serial=foobar`. This makes it
easier to work with multiple disks when testing more complex storage
setups.
@jlebon
Copy link
Member Author

jlebon commented Nov 28, 2022

any chance we could get some documentation for this?

Done!

@dustymabe
Copy link
Member

docs look great! will let @prestist review the code.

@@ -107,13 +107,16 @@ func ParseDiskSpec(spec string) (*Disk, error) {
split := strings.Split(spec, ":")
var size string
multipathed := false
sectorSize := 0
Copy link
Member

Choose a reason for hiding this comment

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

(In Rust this would be an Option<u32> which would better express semantics)

Copy link
Contributor

@prestist prestist left a comment

Choose a reason for hiding this comment

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

LGTM great job!

@jlebon jlebon merged commit 025ba85 into coreos:main Nov 30, 2022
@jlebon jlebon deleted the pr/add-disk-4k-and-serial branch November 30, 2022 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants