Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 343353 - app-emulation/libvirt-0.8.5: compilation failed with undeclared MAX_VIRT_CPUS
Summary: app-emulation/libvirt-0.8.5: compilation failed with undeclared MAX_VIRT_CPUS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Virtualization Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-30 09:58 UTC by Jiří Moravec
Modified: 2010-10-30 17:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiří Moravec 2010-10-30 09:58:25 UTC
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!
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-10-30 16:39:04 UTC
You just gotta love libvirt releases: broken without Xen, broken with Xen.
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-10-30 17:54:40 UTC
Should be fixed in 0.8.5-r1 (along with another problem).