diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2017-07-14 17:22:59 +0200 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2017-07-14 22:07:57 +0200 |
commit | b8e109d6acf61df5c02825f5b485239649f4ea31 (patch) | |
tree | 0851ec009abe1cefd10c6cc3e845e83e19420215 /nixos | |
parent | 292827b0e0a52312a1abe67bfc8baa44afd04e27 (diff) |
nixos/libvirt: prevent OVMF path from being garbage collected
Use xmlstarlet to update the OVMF path on each startup, like we do for
<emulator>...qemu-kvm</emulator>.
A libvirt domain using UEFI cannot start if the OVMF path is garbage
collected/missing.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/virtualisation/libvirtd.nix | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/libvirtd.nix b/nixos/modules/virtualisation/libvirtd.nix index c8742b27c6d5..b24ea0f33c9e 100644 --- a/nixos/modules/virtualisation/libvirtd.nix +++ b/nixos/modules/virtualisation/libvirtd.nix @@ -167,6 +167,9 @@ in { new_emulator=$(PATH=${pkgs.libvirt}/libexec:$PATH command -v $(basename "$emulator")) # write back "${pkgs.xmlstarlet}/bin/xmlstarlet" edit --inplace --update "/domain/devices/emulator" -v "$new_emulator" "$file" + + # Also refresh the OVMF path. Files with no matches are ignored. + "${pkgs.xmlstarlet}/bin/xmlstarlet" edit --inplace --update "/domain/os/loader" -v "${pkgs.OVMF.fd}/FV/OVMF_CODE.fd" "$file" done ''; # */ |