Update rc.libvirt

This commit is contained in:
bergware
2023-08-15 14:56:25 +02:00
parent 9cd5518439
commit e5c5035b4b
+6 -4
View File
@@ -159,7 +159,9 @@ waitstop() {
return 1
}
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
version() {
echo $1 | awk -F. '{printf("%d%03d%03d%03d", $1,$2,$3,$4);}'
}
start_libvirtd() {
if [[ -f $LIBVIRTD_PIDFILE ]]; then
@@ -174,9 +176,9 @@ start_libvirtd() {
sed -ri "s/<vendor id='none'\/>/<vendor_id state='on' value='none'\/>/g" /etc/libvirt/qemu/*.xml &> /dev/null
# remove <locked/> from xml because libvirt + virlogd + virlockd has an issue with locked
sed -ri "s/<locked\/>//g" /etc/libvirt/qemu/*.xml &> /dev/null
# Remove "<watchdog model='itco' action='reset'/>" if rerting from later release.
VERSION=$(sed -n 's/.*version *= *\"\([^ ]*.*\)\"/\1/p' < /etc/unraid-version)
if [ $(version $VERSION) -le $(version "6.12.9") ]; then
# Remove "<watchdog model='itco' action='reset'/>" if reverting from later release.
. /etc/unraid-version
if [[ $(version $version) -le $(version "6.12.9") ]]; then
sed -ri "/<watchdog model='itco' action='reset'\/>/d" /etc/libvirt/qemu/*.xml &> /dev/null
fi
# update interface section((s) of VM configuration files