mirror of
https://github.com/unraid/webgui.git
synced 2026-02-24 19:35:32 -06:00
rc.libvirt: skip non-existing XML files
This commit is contained in:
@@ -181,14 +181,15 @@ libvirtd_start(){
|
||||
return 1
|
||||
fi
|
||||
# convert libvirt 1.3.1 w/ eric's hyperv vendor id patch to how libvirt does it in libvirt 1.3.3+
|
||||
sed -ri "s/<vendor id='none'\/>/<vendor_id state='on' value='none'\/>/g" /etc/libvirt/qemu/*.xml &>/dev/null
|
||||
sed -ri "s/<vendor id='none'\/>/<vendor_id state='on' value='none'\/>/g" /etc/libvirt/qemu/*.xml 2>/dev/null
|
||||
# remove <locked/> from xml because libvirt + virlogd + virlockd has an issue with locked
|
||||
sed -ri "/<locked\/>/d" /etc/libvirt/qemu/*.xml &>/dev/null
|
||||
sed -ri "/<locked\/>/d" /etc/libvirt/qemu/*.xml 2>/dev/null
|
||||
# Remove "<watchdog model='itco' action='reset'/>" if reverting from later release.
|
||||
. /etc/unraid-version
|
||||
[[ $(version $version) -le $(version "6.12") ]] && sed -ri "/<watchdog model='itco' action='reset'\/>/d" /etc/libvirt/qemu/*.xml &>/dev/null
|
||||
[[ $(version $version) -le $(version "6.12") ]] && sed -ri "/<watchdog model='itco' action='reset'\/>/d" /etc/libvirt/qemu/*.xml 2>/dev/null
|
||||
# update interface section((s) of VM configuration files
|
||||
for XML in /etc/libvirt/qemu/*.xml; do
|
||||
[[ -f "$XML" ]] || continue
|
||||
# get all interface sections
|
||||
ROW=($(grep -nhP '<interface type=' "$XML" | grep -Pom1 '^[0-9]+'))
|
||||
# get all source sections
|
||||
|
||||
Reference in New Issue
Block a user