From 4b44f977db3044396cd1b9e569100af1da9af767 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 11 Jan 2013 04:35:56 +0100 Subject: [PATCH] dom0/spec: fix HVM settings on upgrade HVM should have meminfo-writer disabled by default (and now have). But existing VMs have it already enabled so it must be fixed now. Generic HVM isn't capable of dynamic memory management. Previously it was forced to always have maxmem=memory but it wasn't fully correct because someone could install Qubes agents/PV drivers including meminfo-writer and xen-balloon even in HVM so it should be possible to turn it. --- rpm_spec/core-dom0.spec | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/rpm_spec/core-dom0.spec b/rpm_spec/core-dom0.spec index 8a0ec81b..1d120514 100644 --- a/rpm_spec/core-dom0.spec +++ b/rpm_spec/core-dom0.spec @@ -291,6 +291,25 @@ fi mkdir -p /var/lib/qubes/removed-udev-scripts mv -f /lib/udev/rules.d/69-xorg-vmmouse.rules /var/lib/qubes/removed-udev-scripts/ 2> /dev/null || : +if [ "$1" -gt 1 ] ; then + # upgrade + + # Fix HVM setting - meminfo-writer was erroneously enabled by default + cat << __EOF__ | python +from qubes.qubes import QubesVmCollection +qc = QubesVmCollection () +qc.lock_db_for_writing () +qc.load () +for vm in qc.values(): + if vm.type == "HVM" and vm.memory == vm.maxmem: + vm.services['meminfo-writer'] = False + +qc.save() +qc.unlock_db () +exit() +__EOF__ + +fi %clean rm -rf $RPM_BUILD_ROOT rm -f %{name}-%{version}