aboutsummaryrefslogtreecommitdiff
path: root/kvm-stub.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2014-10-31 16:38:32 +0000
committerMichael S. Tsirkin <mst@redhat.com>2014-11-23 12:11:29 +0200
commitb8865591d4d5680b4f766c25ca1db110320b4d15 (patch)
tree7961f3f9de5c4dd137bebadd335d7bb5375a6e87 /kvm-stub.c
parentc409572678936d3ffa8694f5a1dae531c2212e21 (diff)
downloadqemu-b8865591d4d5680b4f766c25ca1db110320b4d15.zip
qemu-b8865591d4d5680b4f766c25ca1db110320b4d15.tar.gz
qemu-b8865591d4d5680b4f766c25ca1db110320b4d15.tar.bz2
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 'kvm-stub.c')
-rw-r--r--kvm-stub.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kvm-stub.c b/kvm-stub.c
index 43fc0dd..7ba90c5 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -147,4 +147,9 @@ int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, int virq)
{
return -ENOSYS;
}
+
+bool kvm_has_free_slot(MachineState *ms)
+{
+ return false;
+}
#endif