Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 407547 - app-emulation/qemu-kvm-1.0-r3 - KVM_AMD and KVM_INTEL should be optional
Summary: app-emulation/qemu-kvm-1.0-r3 - KVM_AMD and KVM_INTEL should be optional
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo QEMU Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-09 15:08 UTC by Timothy Miller
Modified: 2012-03-21 17:34 UTC (History)
2 users (show)

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 Timothy Miller 2012-03-09 15:08:01 UTC
When I try to build app-emulation/qemu-kvm-1.0-r3, I get the following error message:

 *   If you have an AMD CPU, you must enable KVM_AMD in                                 your kernel configuration.
 * Please check to make sure these options are set correctly.
 * Failure to do so may cause unexpected problems.
 * Once you have satisfied these options, please try merging
 * this package again.
 * ERROR: app-emulation/qemu-kvm-1.0-r3 failed (pretend phase):
 *   Incorrect kernel configuration options
 * 
 * Call stack:
 *                ebuild.sh, line  85:  Called pkg_pretend
 *   qemu-kvm-1.0-r3.ebuild, line 163:  Called check_extra_config
 *        linux-info.eclass, line 783:  Called die
 * The specific snippet of code:
 *              die "Incorrect kernel configuration options"
 * 
 * If you need support, post the output of 'emerge --info =app-emulation/qemu-kvm-1.0-r3',
 * the complete build log and the output of 'emerge -pqv =app-emulation/qemu-kvm-1.0-r3'.
 * The complete build log is located at '/var/tmp/portage/app-emulation/qemu-kvm-1.0-r3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-emulation/qemu-kvm-1.0-r3/temp/die.env'.
 * S: '/var/tmp/portage/app-emulation/qemu-kvm-1.0-r3/work/qemu-kvm-1.0'


Unfortunately, I find that /var/tmp/portage is empty after this, which suggests that the temporary build files are either in another place, or the package is erroneously cleaning up after itself despite the failure.  Also, this is the first time I've ever gotten this error.  The KVM kernel module gets built, and it's configured to be loaded on boot.


Reproducible: Always




compute0 millerti # emerge --info
Portage 2.1.10.47 (default/linux/amd64/10.0, gcc-4.5.3, glibc-2.14.1-r2, 3.2.6-gentoo x86_64)
=================================================================
System uname: Linux-3.2.6-gentoo-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9450_@_2.66GHz-with-gentoo-2.1
Timestamp of tree: Fri, 09 Mar 2012 08:00:01 +0000
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.7-r3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.3
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2

sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.2 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r2
Repositories: gentoo local_overlay
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -ggdb -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=core2 -ggdb -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=2"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://gentoo.netnitco.net http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ ftp://mirror.datapipe.net/gentoo ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ http://gentoo.mirrors.easynews.com/linux/gentoo/ ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ ftp://gentoo.imj.fr/pub/gentoo/ ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_US"
MAKEOPTS="--jobs=3 --load-average=7"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac aalib accessibility acl acpi alsa amd64 apache2 apng aspell autotrace bash-completion berkdb bidi bonjour bzip2 cairo cdda cdio cdr cli clucene composite consolekit cracklib crypt ctype cups curl cxx dbus declarative device-mapper dri dts dvd dvdr encode exif extras fbcon ffmpeg fftw filter flac fontconfig fortran freetype gcj gd gdbm git glib gmm gnutls gpm graphviz gs gudev httpd iconv imagemagick ipp ipv6 ithreads jadetex java jpeg jpeg2k kde kde4 kerberos kpathsea kvm lame lapack largefile latex lcms ldap live lm_sensors lzma mad matroska mdnsresponder-compat minizip mjpeg mkl mmx mng modules mp3 mpeg mudflap multilib mysql mysqli ncurses nls nptl nptlonly ogg oggvorbis openexr opengl openmp openssl pam pcre pdf perl php plasma plotutils png policykit ppds pppd python qemu qt3support qt4 quicktime readline reports rss ruby samba sasl sdl secure-delete semantic-desktop session smp spl sql sse sse2 sse3 ssl stream subversion svg sysfs tcl tcpd theora threads thumbnail tiff tk tordns tordnsi truetype unicode utempter vcd vlm vnc vorbis webkit wxwindows x264 xcomposite xml xorg xv xvid zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Ben Kohler gentoo-dev 2012-03-09 16:09:50 UTC
It's failing during the pre-build checks, before anything really happens.  You need to enable the proper kernel options.

That said, these checks have now been changed (~17 hrs ago) to just WARN instead of FAIL when not set:

08 Mar 2012; Doug Goldstein <cardoe@gentoo.org> qemu-kvm-1.0-r3.ebuild:
 Only warn about the lack of kvm-amd or kvm-intel on amd64 and x86.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2012-03-12 12:01:08 UTC
There is no build log because the phase pkg_pretend() fails, which is run before any work is done in PORTAGE_TMPDIR.

I think it's down to these lines:

            ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"                                                      
            ERROR_KVM_AMD+=" your kernel configuration."
            ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"                                                             
            ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." 

Why should these be errors? It should be entirely possible to enable KWM_AMD *or* KVM_INTEL, and not both.

Should probably be WARNING_* in both cases?
Comment 3 Doug Goldstein (RETIRED) gentoo-dev 2012-03-12 13:58:48 UTC
(In reply to comment #2)
> There is no build log because the phase pkg_pretend() fails, which is run
> before any work is done in PORTAGE_TMPDIR.
> 
> I think it's down to these lines:
> 
>             ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD
> in"                                                      
>             ERROR_KVM_AMD+=" your kernel configuration."
>             ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"     
> 
>             ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." 
> 
> Why should these be errors? It should be entirely possible to enable KWM_AMD
> *or* KVM_INTEL, and not both.
> 
> Should probably be WARNING_* in both cases?

Jer,

You aren't understanding how the eclass works. The variable is always ERROR_. You just prefix in the list of values to ~ it will just warn. Which is exactly how it works and the first comment confirms this. The bug was opened with an old rsync.
Comment 4 Martin von Gagern 2012-03-21 17:34:07 UTC
(In reply to comment #3)
> > Should probably be WARNING_* in both cases?
> 
> You aren't understanding how the eclass works. The variable is always
> ERROR_. You just prefix in the list of values to ~ it will just warn.

I still got this reported as an error, although a non-fatal one. And Jer is correct about the solution. Have a look at linux-info.eclass. CVS rev 1.91 as in
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/linux-info.eclass?revision=1.91&view=markup is current. Line 757 will change the report_func from eerror to ewarn only if the variables are called WARNING_* instead of ERROR_*, in addition to the variable being prefixed by ~.

CONFIG_CHECK="CFG" with ERROR_CFG="foo" is a hard error, will die.
CONFIG_CHECK="~CFG" with ERROR_CFG="foo" is a "soft error", will build but still report the issue using eerror, i.e. something that is actually broken.
CONFIG_CHECK="~CFG" with WARNING_CFG="foo" is a warning, so we want this.

This fact isn't documented anywhere. I've just filed bug #409207 to address that. But even without documentation, you surely want to report warnings only, i.e. call ewarn instead of eerror, by changing the variable names.