diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2013-12-09 19:41:44 +0100 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2013-12-09 19:41:44 +0100 |
commit | 0856500f3ed0f01eb7993cb98a2088d624ddbdad (patch) | |
tree | 047fef6bd0455769f39a1e2dcdad590840a267be /nixos | |
parent | ac21aa9a8295c60ac846abcb26e54878dabe2f4f (diff) | |
download | nixlib-0856500f3ed0f01eb7993cb98a2088d624ddbdad.tar nixlib-0856500f3ed0f01eb7993cb98a2088d624ddbdad.tar.gz nixlib-0856500f3ed0f01eb7993cb98a2088d624ddbdad.tar.bz2 nixlib-0856500f3ed0f01eb7993cb98a2088d624ddbdad.tar.lz nixlib-0856500f3ed0f01eb7993cb98a2088d624ddbdad.tar.xz nixlib-0856500f3ed0f01eb7993cb98a2088d624ddbdad.tar.zst nixlib-0856500f3ed0f01eb7993cb98a2088d624ddbdad.zip |
nixos/libvirtd-service: fix fail-to-start when no machines are configured
Don't fail to start the libvirtd service just because there are no files that match the /etc/libvirt/qemu/*.xml pattern.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/virtualisation/libvirtd.nix | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/libvirtd.nix b/nixos/modules/virtualisation/libvirtd.nix index d8668eb16072..583b09192e33 100644 --- a/nixos/modules/virtualisation/libvirtd.nix +++ b/nixos/modules/virtualisation/libvirtd.nix @@ -107,6 +107,7 @@ in # while still being used by the virtual machine. So update the # emulator path on each startup to something valid (re-scan $PATH). for file in /etc/libvirt/qemu/*.xml; do + test -f "$file" || continue # get (old) emulator path from config file emulator=$(grep "^[[:space:]]*<emulator>" "$file" | sed 's,^[[:space:]]*<emulator>\(.*\)</emulator>.*,\1,') # get a (definitely) working emulator path by re-scanning $PATH |