]> xenbits.xensource.com Git - libvirt.git/commit
qemu_driver: Try KVM_CAP_MAX_VCPUS only if defined
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 13 Mar 2013 10:29:38 +0000 (11:29 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 13 Mar 2013 13:31:29 +0000 (14:31 +0100)
commit3b94239ffbb2489d9920107aaadcb108adde8f58
tree7523338d880375b57fd2ba6a2928658f810e992a
parent27cf98e2d12cca72ea2001024b745a8f599ef68d
qemu_driver: Try KVM_CAP_MAX_VCPUS only if defined

With our recent patch (1715c83b5f) we thrive to get the correct
number of maximal VCPUs. However, we are using a constant from
linux/kvm.h which may be not defined in every distro. Hence, we
should guard usage of the constant with ifdef preprocessor
directive. This was introduced in kernel:

    commit 8c3ba334f8588e1d5099f8602cf01897720e0eca
    Author: Sasha Levin <levinsasha928@gmail.com>
    Date:   Mon Jul 18 17:17:15 2011 +0300

    KVM: x86: Raise the hard VCPU count limit

    The patch raises the hard limit of VCPU count to 254.

    This will allow developers to easily work on scalability
    and will allow users to test high VCPU setups easily without
    patching the kernel.

    To prevent possible issues with current setups, KVM_CAP_NR_VCPUS
    now returns the recommended VCPU limit (which is still 64) - this
    should be a safe value for everybody, while a new KVM_CAP_MAX_VCPUS
    returns the hard limit which is now 254.

$ git desc 8c3ba334f
v3.1-rc7-48-g8c3ba33
src/qemu/qemu_driver.c