From 86026e364f203366e200c720b5365ea16562ce91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 29 Jan 2018 22:57:32 +0100 Subject: [PATCH] Fix starting PCI-having HVMs on early system boot and later 1. Make sure VMs are started after dom0 actual memory usage is reported to qmemman, otherwise dom0 will hold 4GB, even if just a little over 1GB is needed at that time. 2. Request only vm.memory MB from qmemman, instead of vm.maxmem. While HVM with PCI devices indeed do not support populate-on-demand, this is already handled in libvirt XML. The later may often cause VM startup fail on systems with 8GB of memory, because maxmem is 4GB there and with dom0 keeping the other 4GB (see point 1) there is not enough memory to start any sych VM. Fixes QubesOS/qubes-issues#3462 --- linux/systemd/qubes-vm@.service | 2 +- qubes/vm/qubesvm.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/linux/systemd/qubes-vm@.service b/linux/systemd/qubes-vm@.service index 96ecf99d..0ff2255a 100644 --- a/linux/systemd/qubes-vm@.service +++ b/linux/systemd/qubes-vm@.service @@ -1,7 +1,7 @@ [Unit] Description=Start Qubes VM %i Before=systemd-user-sessions.service -After=qubesd.service +After=qubesd.service qubes-meminfo-writer-dom0.service [Service] Type=oneshot diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index e30b893b..b6892a28 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -1244,10 +1244,6 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM): stubdom_mem = 0 initial_memory = self.memory - if self.virt_mode == 'hvm' and self.devices['pci'].persistent(): - # HVM with PCI devices does not support populate-on-demand on - # Xen - initial_memory = self.maxmem mem_required = int(initial_memory + stubdom_mem) * 1024 * 1024 qmemman_client = qubes.qmemman.client.QMemmanClient()