]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix initialization of current vcpus in libxl driver
authorJim Fehlig <jfehlig@novell.com>
Mon, 23 May 2011 22:06:00 +0000 (16:06 -0600)
committerJim Fehlig <jfehlig@novell.com>
Tue, 24 May 2011 20:13:04 +0000 (14:13 -0600)
commit492e493a1e6f31551583bb7de9500c312b716f42
tree43ce3c403d7423ebbc161be72da7093ce541dcb1
parent4486f3a209cff1da44b2bb83f0aa41a67d5e623e
Fix initialization of current vcpus in libxl driver

The cur_vcpus member of struct libxl_domain_build_info was incorrectly
initialized to the number of vcpus, when it should have been interpreted
as a bitmap, where bit X corresponds to online/offline status of vcpuX.

To complicate matters, cur_vcpus is an int, so only 32 vcpus can be
set online.  Add a check to ensure vcpus does not exceed this limit.

V2: Eric Blake noted a compilation pitfal when '1 << 32' on an int.
    Account for vcpus == 32.
src/libxl/libxl_conf.c