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.
This commit is contained in:
Bjørn Forsman 2013-12-09 19:41:44 +01:00
parent ac21aa9a82
commit 0856500f3e

View file

@ -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