From da97f4d84c3c3d8e93fb029e7e5abd6180a586f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 18 Nov 2017 02:37:38 +0100 Subject: [PATCH] qubesvm: make initial qmemman request consistent with libvirt config If HVM have PCI device, it can't use PoD, so need 'maxmem' memory to be started. Request that much from qmemman. Note that is is somehow independent of enabling or not dynamic memory management for the VM (`service.meminfo-writer` feature). Even if VM initially had assigned maxmem memory, it can be later ballooned down. QubesOS/qubes-issues#3207 --- qubes/vm/qubesvm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 972c160d..3e857900 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -1244,7 +1244,12 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM): else: stubdom_mem = 0 - mem_required = int(self.memory + stubdom_mem) * 1024 * 1024 + 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() try: