From 0856500f3ed0f01eb7993cb98a2088d624ddbdad Mon Sep 17 00:00:00 2001 From: Bjørn Forsman Date: Mon, 9 Dec 2013 19:41:44 +0100 Subject: 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. --- nixos/modules/virtualisation/libvirtd.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'nixos') 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:]]*" "$file" | sed 's,^[[:space:]]*\(.*\).*,\1,') # get a (definitely) working emulator path by re-scanning $PATH -- cgit 1.4.1