-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
nixos/qemu-vm: refactor bootDisk using make-disk-image #207039
Conversation
0102cdc
to
486bf1e
Compare
486bf1e
to
b2ac559
Compare
@RaitoBezarius The comments sound like you still want to work on this. What's the status here? |
Didn't have time to fix my own comments yet, but it's open to additional comments. |
b2ac559
to
b82c8f9
Compare
b82c8f9
to
5b082f5
Compare
3fde81c
to
371d377
Compare
Latest evaluation: https://hydra.nixos.org/eval/1793584?compare=-172800&full=0#tabs-now-fail |
fd8d369
to
5724827
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.
I'm not the most knowledgeable about the qemu-vm test stuff, but this change feels sane to me
Since it changes some semantics it could have some fallout for downstream users, but I don't imagine there are many and it should hopefully be easy for them to understand and update
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/2090 |
5724827
to
792fd0a
Compare
It looks like
|
If I remember well, the failure is alas unrelated. It's because GRUB tries to install legacy for a UEFI only target. |
Yeah the error message sounded like that was the issue It looks like the NixOS GRUB module assumes that it needs to install legacy unless |
Thank you for going in the rabbit hole, I rediscover this each time. :) |
So I don't know if this is "correct" necessarily, but this diff on top of this PR does allow a number of grub tests to pass again (those which currently pass on master and fail on this PR): diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index f85567c42f2..fa928a1ba2f 100644
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -849,7 +849,7 @@ in
${opt.writableStore} = false;
'';
- boot.loader.grub.device = mkVMOverride cfg.bootLoaderDevice;
+ boot.loader.grub.device = mkVMOverride (if cfg.useEFIBoot then "nodev" else cfg.bootLoaderDevice);
boot.loader.grub.gfxmodeBios = with cfg.resolution; "${toString x}x${toString y}";
virtualisation.rootDevice = mkDefault suggestedRootDevice;
|
792fd0a
to
07f5a70
Compare
@lilyinstarlight Adressed and latest evaluation shows that it fixes the GRUB tests: https://hydra.nixos.org/eval/1793709 |
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.
Very cool change. The comments and descriptions could use some more editing. Most of my comments are either nitpicks or revolve around naming. Although I think naming is very important, I think it is more important to get this PR across the finish line. We can still improve the naming later.
318c68b
to
58f7c4e
Compare
Started a new evaluation here: https://hydra.nixos.org/jobset/nixos/python-test-refactoring |
58f7c4e
to
e81f8d2
Compare
This option has been introduced in 678eed3 without realizing there was this PR inflight, unfortunately, it collide with what this PR does and make it irrelevant. Therefore, I remove it here.
I do a lot of work on QEMU VM and make-disk-image and I was bitten by an unnotified change recently, so I want to chime in the future changes of this file.
e81f8d2
to
76f1b63
Compare
Finally, this will be merged once ofborg CI passes. |
Thanks to everyone involved in this journey. :) |
This PR broke nixosTests.kexec. It seems like the final Hydra eval had that test as broken, so maybe it's worth a look to see if any other tests were found to be broken during that eval and overlooked? |
Hmm, I will investigate this further. I remember that some of the stuff
seemed already broken on master but I may have done mistakes. Thank you for
the heads-up!
Le ven. 19 mai 2023 à 23:45, Alyssa Ross ***@***.***> a
écrit :
… This PR broke nixosTests.kexec. It seems like the final Hydra eval had
that test as broken, so maybe it's worth a look to see if any other tests
were found to be broken during that eval and overlooked?
—
Reply to this email directly, view it on GitHub
<#207039 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACMZRE4RFCHNMRJXUHLYU3XG7SZBANCNFSM6AAAAAATE4LUVY>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Description of changes
Depends on #207038.
A small cover letter on the changes:
We remove the
bootDisk
ad-hoc generation and rewire it up withmake-disk-image
, this unlocks various features:make-disk-image
)rootDevice
,bootDevice
andbootPartition
which clarify further the different roles of the disk in the VM world we use, to cater for legacy (disk-level) and UEFI (partition-level) needs.persistBootDevice
introduced in 678eed3Testing is done on https://hydra.nixos.org/jobset/nixos/python-test-refactoring on a recent enough: nixos-unstable-small and treewide cleanups are done.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes