|
@@ -132,7 +132,7 @@ static const KVMCapabilityInfo kvm_required_capabilites[] = {
|
|
|
KVM_CAP_LAST_INFO
|
|
|
};
|
|
|
|
|
|
-static KVMSlot *kvm_alloc_slot(KVMState *s)
|
|
|
+static KVMSlot *kvm_get_free_slot(KVMState *s)
|
|
|
{
|
|
|
int i;
|
|
|
|
|
@@ -142,6 +142,22 @@ static KVMSlot *kvm_alloc_slot(KVMState *s)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+bool kvm_has_free_slot(MachineState *ms)
|
|
|
+{
|
|
|
+ return kvm_get_free_slot(KVM_STATE(ms->accelerator));
|
|
|
+}
|
|
|
+
|
|
|
+static KVMSlot *kvm_alloc_slot(KVMState *s)
|
|
|
+{
|
|
|
+ KVMSlot *slot = kvm_get_free_slot(s);
|
|
|
+
|
|
|
+ if (slot) {
|
|
|
+ return slot;
|
|
|
+ }
|
|
|
+
|
|
|
fprintf(stderr, "%s: no free slot available\n", __func__);
|
|
|
abort();
|
|
|
}
|