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:
parent
ac21aa9a82
commit
0856500f3e
@ -107,6 +107,7 @@ in
|
|||||||
# while still being used by the virtual machine. So update the
|
# while still being used by the virtual machine. So update the
|
||||||
# emulator path on each startup to something valid (re-scan $PATH).
|
# emulator path on each startup to something valid (re-scan $PATH).
|
||||||
for file in /etc/libvirt/qemu/*.xml; do
|
for file in /etc/libvirt/qemu/*.xml; do
|
||||||
|
test -f "$file" || continue
|
||||||
# get (old) emulator path from config file
|
# get (old) emulator path from config file
|
||||||
emulator=$(grep "^[[:space:]]*<emulator>" "$file" | sed 's,^[[:space:]]*<emulator>\(.*\)</emulator>.*,\1,')
|
emulator=$(grep "^[[:space:]]*<emulator>" "$file" | sed 's,^[[:space:]]*<emulator>\(.*\)</emulator>.*,\1,')
|
||||||
# get a (definitely) working emulator path by re-scanning $PATH
|
# get a (definitely) working emulator path by re-scanning $PATH
|
||||||
|
Loading…
x
Reference in New Issue
Block a user