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 module: add virtualisation.cores option #24999

Merged
merged 1 commit into from Apr 25, 2017
Merged

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Apr 18, 2017

QEMU can allow guests to access more than one host core at a time.
Previously, this had to be done via ad-hoc arguments:

virtualisation.qemu.options = ["-smp 12"];

Now you can simply specify:

virtualisation.cores = 12;
Motivation for this change

In my NixOS based tests, we frequently need far more than a single core available to the guest. Manually passing in -smp doesn't represent what we want, so much as how to do it.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@grahamc, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @peti and @aszlig to be potential reviewers.

@@ -244,6 +245,17 @@ in
'';
};

virtualisation.cores =
mkOption {
default = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a type?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added. LGTY?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

QEMU can allow guests to access more than one host core at a time.
Previously, this had to be done via ad-hoc arguments:

    virtualisation.qemu.options = ["-smp 12"];

Now you can simply specify:

    virtualisation.cores = 12;
@grahamc grahamc merged commit 3ab98d0 into NixOS:master Apr 25, 2017
@grahamc grahamc deleted the qemu branch April 25, 2017 01:30
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