Skip to content

Conversation

@ekronborg
Copy link
Contributor

Signed-off-by: Emil Kronborg Andersen emil.kronborg@protonmail.com

Description
Allow usage of Q35-based machines in QEMU.

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • CHANGES.rst has been updated
  • PR has been tested
  • Man pages have been regenerated

elif self.machine == "q35":
self._cmd.append("-drive")
self._cmd.append(
f"format={disk_format},file={disk_path}")
Copy link
Member

Choose a reason for hiding this comment

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

Is if=virtio the default now?

We should probably keep the root=... rootwait or is there a downside?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, if=ide is default for q35. Should I include that?

I think it is fine to include rootwait, but I would expect people to define root and rootfstype in local.yaml if it is not handled by their bootloader. By appending them to boot_args, you effectively overwrite any boot or rootfstype defined in local.yaml and thus hardcode them or did I miss anything? For example, if i spin up a pc machine, I will always have root=/dev/vda, no?

Copy link
Member

Choose a reason for hiding this comment

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

No, if=ide is default for q35. Should I include that?

I'd argue that we q35 should behave mostly similar to the existing pc config.

I think it is fine to include rootwait, but I would expect people to define root and rootfstype in local.yaml if it is not handled by their bootloader. By appending them to boot_args, you effectively overwrite any boot or rootfstype defined in local.yaml and thus hardcode them or did I miss anything? For example, if i spin up a pc machine, I will always have root=/dev/vda, no?

The boot_args are only passed to qemu if a kernel is started directly:
https://github.com/labgrid-project/labgrid/blob/master/labgrid/driver/qemudriver.py#L174-L176

Also, custom boot_args are appended after the autogenerated ones
(https://github.com/labgrid-project/labgrid/blob/master/labgrid/driver/qemudriver.py#L172-L173), which allows the user to override them in the yaml.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd argue that we q35 should behave mostly similar to the existing pc config.

If we keep the interface default for q35, i.e., if=ide, I agree.

The boot_args are only passed to qemu if a kernel is started directly:
https://github.com/labgrid-project/labgrid/blob/master/labgrid/driver/qemudriver.py#L174-L176

Also, custom boot_args are appended after the autogenerated ones
(https://github.com/labgrid-project/labgrid/blob/master/labgrid/driver/qemudriver.py#L172-L173), which allows the user to override them in the yaml.

Now it makes sense to me. Thanks for clarifying. I will include root=... rootwait to q35 also.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I misread the diff and went ahead with the merge. Could you add the root= in a new PR? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was confused for a second. Yes, I will make a new PR.

Signed-off-by: Emil Kronborg Andersen <emil.kronborg@protonmail.com>
@codecov
Copy link

codecov bot commented Aug 5, 2022

Codecov Report

Merging #961 (9bdacb2) into master (dffc61d) will decrease coverage by 0.0%.
The diff coverage is 0.0%.

@@           Coverage Diff            @@
##           master    #961     +/-   ##
========================================
- Coverage    57.1%   57.1%   -0.1%     
========================================
  Files         150     150             
  Lines       11199   11202      +3     
========================================
  Hits         6402    6402             
- Misses       4797    4800      +3     
Impacted Files Coverage Δ
labgrid/driver/qemudriver.py 75.1% <0.0%> (-1.4%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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