]>
Commit | Line | Data |
---|---|---|
4676c0af DM |
1 | see http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commitdiff;h=8fa3b3ce6e#patch1 |
2 | ||
3 | KVM_GET_SUPPORTED_CPUID has been known to fail to return -E2BIG | |
4 | when it runs out of entries. Detect this by always trying again | |
5 | with a bigger table if the ioctl() fills the table. | |
6 | ||
7 | --- a/kvm/libkvm/libkvm-x86.c | |
8 | +++ b/kvm/libkvm/libkvm-x86.c | |
9 | @@ -575,6 +575,8 @@ static struct kvm_cpuid2 *try_get_cpuid(kvm_context_t kvm, int max) | |
10 | r = ioctl(kvm->fd, KVM_GET_SUPPORTED_CPUID, cpuid); | |
11 | if (r == -1) | |
12 | r = -errno; | |
13 | + else if (r == 0 && cpuid->nent >= max) | |
14 | + r = -E2BIG; | |
15 | if (r < 0) { | |
16 | if (r == -E2BIG) { | |
17 | free(cpuid); | |
18 |