From b8865591d4d5680b4f766c25ca1db110320b4d15 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Fri, 31 Oct 2014 16:38:32 +0000 Subject: pc: kvm: check if KVM has free memory slots to avoid abort() When more memory devices are used than available KVM memory slots, QEMU crashes with: kvm_alloc_slot: no free slot available Aborted (core dumped) Fix this by checking that KVM has a free slot before attempting to map memory in guest address space. Signed-off-by: Igor Mammedov Acked-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/sysemu/kvm.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index b0cd657f77..22e42ef236 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -163,6 +163,7 @@ extern KVMState *kvm_state; /* external API */ +bool kvm_has_free_slot(MachineState *ms); int kvm_has_sync_mmu(void); int kvm_has_vcpu_events(void); int kvm_has_robust_singlestep(void); -- cgit v1.2.3