Dumb down meminfo-writer enabling logic

Let dom0 decide whether it should be enabled or not, regardless of PCI
devices or any other factor.

Fixes QubesOS/qubes-issues#3207
This commit is contained in:
Marek Marczykowski-Górecki 2017-11-18 02:42:11 +01:00
parent 57a3c2d67e
commit e53db1386d
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -5,38 +5,11 @@
. /usr/lib/qubes/init/functions
# List of services enabled by default (in case of absence of qubesdb entry)
DEFAULT_ENABLED_NETVM="network-manager qubes-network qubes-update-check qubes-updates-proxy"
DEFAULT_ENABLED_PROXYVM="qubes-network qubes-firewall qubes-update-check"
DEFAULT_ENABLED_APPVM="cups qubes-update-check"
DEFAULT_ENABLED_NETVM="network-manager qubes-network qubes-update-check qubes-updates-proxy meminfo-writer"
DEFAULT_ENABLED_PROXYVM="qubes-network qubes-firewall qubes-update-check meminfo-writer"
DEFAULT_ENABLED_APPVM="cups qubes-update-check meminfo-writer"
DEFAULT_ENABLED_TEMPLATEVM="$DEFAULT_ENABLED_APPVM updates-proxy-setup"
DEFAULT_ENABLED=""
# devices emulated by qemu, first list of vendor IDs then list of device IDs:
qemu_devices="0x8086
0x8086
0x8086
0x8086
0x8086
0x5853
0x1013
0x1237
0x7000
0x7010
0x7020
0x7113
0x0001
0x00b8
"
if [ -z "$(ls /sys/bus/pci/devices/)" ] || \
[ "$(cat /sys/bus/pci/devices/*/{vendor,device})" != "$qemu_devices" ]; then
# do not enable meminfo-writer (so qmemman for this domain) when any real PCI
# device is present
DEFAULT_ENABLED="$DEFAULT_ENABLED meminfo-writer"
DEFAULT_ENABLED_APPVM="$DEFAULT_ENABLED_APPVM meminfo-writer"
DEFAULT_ENABLED_PROXYVM="$DEFAULT_ENABLED_PROXYVM meminfo-writer"
DEFAULT_ENABLED_TEMPLATEVM="$DEFAULT_ENABLED_TEMPLATEVM meminfo-writer"
fi
DEFAULT_ENABLED="meminfo-writer"
if systemd_version_changed ; then
# Ensure we're running right version of systemd (the one started by initrd may be different)