summaryrefslogtreecommitdiffstats
path: root/include/sysemu/kvm.h
diff options
context:
space:
mode:
authorIgor Mammedov2014-10-31 17:38:32 +0100
committerMichael S. Tsirkin2014-11-23 11:11:29 +0100
commitb8865591d4d5680b4f766c25ca1db110320b4d15 (patch)
tree7961f3f9de5c4dd137bebadd335d7bb5375a6e87 /include/sysemu/kvm.h
parentqemu-char: fix tcp_get_fds (diff)
downloadqemu-b8865591d4d5680b4f766c25ca1db110320b4d15.tar.gz
qemu-b8865591d4d5680b4f766c25ca1db110320b4d15.tar.xz
qemu-b8865591d4d5680b4f766c25ca1db110320b4d15.zip
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 <imammedo@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/sysemu/kvm.h')
-rw-r--r--include/sysemu/kvm.h1
1 files changed, 1 insertions, 0 deletions
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);