We die() if we can't read KVM_CAP_NR_VCPUS, but the API docs suggest to assume
the value 4 in this case.  This is pertinent to PPC KVM, which currently
does not support this CAP.

Signed-off-by: Matt Evans <m...@ozlabs.org>
---
 tools/kvm/kvm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c
index 0356d74..0bbe9ba 100644
--- a/tools/kvm/kvm.c
+++ b/tools/kvm/kvm.c
@@ -266,7 +266,11 @@ int kvm__recommended_cpus(struct kvm *kvm)
 
        ret = ioctl(kvm->sys_fd, KVM_CHECK_EXTENSION, KVM_CAP_NR_VCPUS);
        if (ret <= 0)
-               die_perror("KVM_CAP_NR_VCPUS");
+               /*
+                * api.txt states that if KVM_CAP_NR_VCPUS does not exist,
+                * assume 4.
+                */
+               return 4;
 
        return ret;
 }
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to