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: allow specifying the machine type #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IsaacJT
Copy link

@IsaacJT IsaacJT commented Apr 12, 2023

This allows QEMU machine types to be used other than the default "pc", such as "q35". Valid alternative machine types can be identified with the qemu-system-x86_64 -M help command.

This is useful for testing images for embedded systems which may not support the "pc" QEMU machine type, or require features from "q35" or other types.

This allows QEMU machine types to be used other than the default "pc",
such as "q35". Valid alternative machine types can be identified with
the `qemu-system-x86_64 -M help` command.

Signed-off-by: Isaac True <[email protected]>

// Type of machine emulated, only for qemu. Defaults to "pc", which is
// the QEMU default for x86_64
MachineType string `yaml:"machine-type"`
Copy link
Contributor

Choose a reason for hiding this comment

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

We try to avoid backend specific options in System, if possible we try to find a generic term that could be reused across various backends. MachineType (or just Machine) is actually not bad as it potentially maps to many different backends, e.g. in linode or google it could map to the machine type like: e2-standard-2. Three is an existing Plan in project.go that is currently used for this.

Which makes me wonder if could consolidate plan and machine somehow, I see some optons:

  1. add new machine and only use in qemu
  2. use plan in the qemu backend and map that to machine type
  3. add new machine and use it in linode/google instead of plan (deprecate plan)
  4. ... something I forgot?

Each has different tradeoffs so input from @niemeyer on this would be best.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @mvo5, modifying the code to use the existing plan variable sounds like a good idea to me as it's currently not in use by the qemu backend. If you and @niemeyer are happy with that I will adjust the PR

Copy link
Author

Choose a reason for hiding this comment

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

Implemented here: #169

I'll keep this PR open in case we want to go in a different direction

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.

2 participants