libvirt-0.8.5 compilation failed in file src/xen/xm_internal.c because MAX_VIRT_CPUS isn't defined before compilation. Reproducible: Always Actual Results: Compilation failed. Expected Results: Compilation ended with no problems. ... CC libvirt_driver_xen_la-xen_inotify.lo xen/xm_internal.c: In function 'xenXMDomainConfigParse': xen/xm_internal.c:774: error: 'MAX_VIRT_CPUS' undeclared (first use in this function) xen/xm_internal.c:774: error: (Each undeclared identifier is reported only once xen/xm_internal.c:774: error: for each function it appears in.) make[3]: *** [libvirt_driver_xen_la-xm_internal.lo] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: Leaving directory `/var/tmp/portage/app-emulation/libvirt-0.8.5/work/libvirt-0.8.5/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/var/tmp/portage/app-emulation/libvirt-0.8.5/work/libvirt-0.8.5/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/app-emulation/libvirt-0.8.5/work/libvirt-0.8.5' make: *** [all] Error 2 emake failed pushd /var/tmp/portage/app-emulation/libvirt-0.8.5/work/libvirt-0.8.5; find -exec strings -f {} \; | grep MAX_VIRT_CPUS; popd ./docs/api_extension/0012-improve-vcpu-support-in-xen-command-line.patch: + /* Computing the vcpu_avail bitmask works because MAX_VIRT_CPUS is 32. */ ./docs/api_extension/0012-improve-vcpu-support-in-xen-command-line.patch: + MAX_VIRT_CPUS < count) ./ChangeLog: MAX_VIRT_CPUS from public headers, breaking compilation of libvirt ./ChangeLog: Ensure MAX_VIRT_CPUS is defined accordingly. ./src/xen/xend_internal.c: /* Computing the vcpu_avail bitmask works because MAX_VIRT_CPUS is 32. */ ./src/xen/xen_hypervisor.c: /* xen-unstable changeset 19788 removed MAX_VIRT_CPUS from public ./src/xen/xen_hypervisor.c: * Ensure MAX_VIRT_CPUS is defined accordingly. ./src/xen/xen_hypervisor.c: #if !defined(MAX_VIRT_CPUS) && defined(XEN_LEGACY_MAX_VCPUS) ./src/xen/xen_hypervisor.c: # define MAX_VIRT_CPUS XEN_LEGACY_MAX_VCPUS ./src/xen/xen_hypervisor.c: return MAX_VIRT_CPUS; ./src/xen/xen_hypervisor.c: maxcpu = MAX_VIRT_CPUS; ./src/xen/xm_internal.c: MAX_VIRT_CPUS < count) According 'find' results, MAX_VIRT_CPUS isn't declared in src/xen/xm_internal.c or any other included or unincluded header file in the whole source tree. Only in src/xen/xen_hypervisor.c exist piece of code which declare this variable but for local usage only. According Changelog record from 2009-11-15: Fix compilation of libvirt against xen-unstable * src/xen/xen_hypervisor.c: xen-unstable changeset 19788 removed MAX_VIRT_CPUS from public headers, breaking compilation of libvirt on -unstable. Its semanitc was retained with XEN_LEGACY_MAX_VCPUS. Ensure MAX_VIRT_CPUS is defined accordingly. developers assumed that MAX_VIRT_CPUS variable IS DEFINED before compilation start. But that assumption isn't fullfiled!
You just gotta love libvirt releases: broken without Xen, broken with Xen.
Should be fixed in 0.8.5-r1 (along with another problem).