Compare commits

...

37 Commits
master ... el6

Author SHA1 Message Date
Lubomir Rintel 96611866a6 Make it build 2012-11-15 07:51:38 +01:00
Lubomir Rintel 2faa60368b Bump build for EPEL 6
- Add EPEL 6 support
- Allow builds without usbredir
- Allow builds without xfsprogs
- Do not stick usbredir to exact revision
- Allow building without libfdt
- Allow builds with intree firmware
- Bring back sysvinit support
2012-11-15 07:51:38 +01:00
Lubomir Rintel 089cdcffa5 Add EPEL 6 support 2012-11-15 07:51:38 +01:00
Lubomir Rintel 683d072d47 Allow building a package that is able to coexist with el6's kvm package
...that's only built for x86_64.
2012-11-15 07:51:38 +01:00
Lubomir Rintel 3cb4ae1d34 Require gpxe-roms-qemu in EPEL6 2012-11-15 07:51:38 +01:00
Lubomir Rintel 71ee860ab3 Allow builds without usbredir 2012-11-15 07:51:38 +01:00
Lubomir Rintel 652de6bd55 Allow builds without xfsprogs 2012-11-15 07:51:37 +01:00
Lubomir Rintel bcd982b3a2 Do not stick certain dependencies to exact revisions
We have older ones in EPEL6 that work well enough.
2012-11-15 07:51:37 +01:00
Lubomir Rintel 651c67e1e6 Allow building without libfdt
Result is not being able to modify fdt to pass kernel arguments on certain
platforms.
2012-11-15 07:51:37 +01:00
Lubomir Rintel 10c2f33ae7 Allow builds with intree firmware 2012-11-15 07:51:37 +01:00
Lubomir Rintel 26c36f3aed Bring back sysvinit support 2012-11-15 07:51:37 +01:00
Lubomir Rintel d9f9605999 Merge branch 'master' into el6
Why is there no git merge -s theirs :(
2012-11-15 07:50:54 +01:00
Fedora Release Engineering 998fc36f6a dist-git conversion 2010-07-29 10:59:29 +00:00
Dennis Gilmore 4a477fbffc Initialize branch EL-6 for qemu 2010-05-08 02:19:53 +00:00
Justin M. Forbes 237fa48455 own docdir, fix non-existent NIC error 2010-04-23 14:57:11 +00:00
Justin M. Forbes 38726d4620 Require the noarch seabios-bin 2010-04-20 21:13:24 +00:00
Justin M. Forbes c17f2093a9 Detect cdrom via ioctl (#473154) re add increased buffer for USB control
requests (#546483)
2010-03-16 02:28:00 +00:00
Justin M. Forbes 89af5928cf Update to 0.12.3, require seabios, Migration clear the fd in error cases
(#518032)
2010-03-10 18:09:38 +00:00
Justin M. Forbes 35a944e0c3 correct date 2010-01-20 21:51:27 +00:00
Justin M. Forbes 1201a69697 - Re-enable preadv/pwritev support (#545006)
- Fix buffer overflow in usb-linux.c (#546483)
2010-01-20 21:50:36 +00:00
Bill Nottingham 549f978acd Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:16:14 +00:00
Mark McLoughlin fbfa11a2ff - Fix a use-after-free crasher in the slirp code (#539583)
- Fix overflow in the parallels image format support (#533573)
2009-11-20 18:28:23 +00:00
Mark McLoughlin b244ee2b02 - Temporarily disable preadv/pwritev support to fix data corruption
(#526549)
2009-11-04 17:37:52 +00:00
Justin M. Forbes 7129dff3ea Default ksm and ksmtuned services on 2009-11-03 15:14:32 +00:00
Mark McLoughlin b8cd60bd19 Fix typo in patch 2009-10-29 12:55:06 +00:00
Mark McLoughlin 597b7ac56d - Fix dropped packets with non-virtio NICs (#531419) 2009-10-29 11:45:24 +00:00
Glauber Costa 32581c4356 Properly save kvm time registers (#524229) 2009-10-21 19:25:00 +00:00
Mark McLoughlin 5533dd1ab7 - Fix potential segfault from too small MSR_COUNT (#528901) 2009-10-19 10:33:42 +00:00
Mark McLoughlin 9965bd2a58 Assume --build-id is always available 2009-10-14 15:57:53 +00:00
Mark McLoughlin 9734688a08 Fixup qemu-img description 2009-10-14 15:45:53 +00:00
Mark McLoughlin c618d4368a remove trailing blanks 2009-10-14 15:34:00 +00:00
Mark McLoughlin 048695dc3a - Fix fs errors with virtio and qcow2 backing file (#524734)
- Fix ksm initscript errors on kernel missing ksm (#527653)
- Add missing Requires(post): getent, useradd, groupadd (#527087)
2009-10-09 14:34:17 +00:00
Mark McLoughlin 355e12ddba Fix syntax error in ksmtuned.init 2009-10-06 13:33:26 +00:00
Mark McLoughlin b7e6445e2f - Add 'retune' verb to ksmtuned init script 2009-10-06 13:26:58 +00:00
Mark McLoughlin d7496c98d6 - Use rtl8029 PXE rom for ne2k_pci, not ne (#526777)
- Also, replace the gpxe-roms-qemu pkg requires with file-based requires
2009-10-05 14:26:45 +00:00
Justin M. Forbes ea7d4b0b7d Update the Release for build 2009-10-01 22:38:01 +00:00
Justin M. Forbes 6443d4e4a5 Improve error reporting on file access (#524695) 2009-10-01 21:29:40 +00:00
5 changed files with 665 additions and 4 deletions

104
ksm.init Normal file
View File

@ -0,0 +1,104 @@
#!/bin/bash
#
# ksm Kernel Samepage Merging
#
# Author: Dan Kenigsberg <danken@redhat.com>
#
# Copyright 2009 Red Hat, Inc. and/or its affiliates.
# Released under the GPL
#
# chkconfig: 345 84 16
# description: The KSM init script starts and stops the ksm kernel thread.
# config: /etc/sysconfig/ksm
#
### BEGIN INIT INFO
# Provides: ksm
# Required-Start:
# Required-Stop:
# Should-Start:
# Default-Start: 3 4 5
# Short-Description: start and stop ksm
# Description: The KSM init script starts and stops the ksm kernel thread.
### END INIT INFO
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/ksm ]; then
. /etc/sysconfig/ksm
fi
prog=ksm
RETVAL=0
# unless KSM_MAX_KERNEL_PAGES is set, let ksm munch up to half of total memory.
default_max_kernel_pages () {
local total pagesize
total=`awk '/^MemTotal:/ {print $2}' /proc/meminfo`
pagesize=`getconf PAGESIZE`
echo $[total * 1024 / pagesize / 2]
}
start() {
echo -n $"Starting $prog: "
if [ -f /sys/kernel/mm/ksm/max_kernel_pages ]; then
KSM_MAX_KERNEL_PAGES=${KSM_MAX_KERNEL_PAGES:-`default_max_kernel_pages`}
echo $KSM_MAX_KERNEL_PAGES > /sys/kernel/mm/ksm/max_kernel_pages
fi
echo 1 > /sys/kernel/mm/ksm/run
RETVAL=$?
[ $RETVAL = 0 ] && success $"$prog startup" || failure $"$prog startup"
echo
}
stop() {
echo -n $"Stopping $prog: "
echo 0 > /sys/kernel/mm/ksm/run
RETVAL=$?
[ $RETVAL = 0 ] && success $"$prog shutdown" || failure $"$prog shutdown"
echo
}
status() {
if [ ! -f /sys/kernel/mm/ksm/run ] ; then
echo $"$prog not supported"
RETVAL=1
else if [ "$(cat /sys/kernel/mm/ksm/run 2>/dev/null)" != "1" ]; then
echo $"$prog is not running"
RETVAL=1
else
echo $"$prog is running"
RETVAL=0
fi; fi
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
condrestart|try-restart)
status >/dev/null 2>&1 || exit 0
restart
;;
force-reload)
restart
;;
*)
echo $"Usage: $prog {start|stop|restart|force-reload|condrestart|try-restart|status|help}"
RETVAL=2
esac
exit $RETVAL

94
ksmtuned.init Normal file
View File

@ -0,0 +1,94 @@
#!/bin/bash
#
# ksmtuned Kernel Samepage Merging (KSM) Tuning Daemon
#
# Author: Dan Kenigsberg <danken@redhat.com>
#
# Copyright 2009 Red Hat, Inc. and/or its affiliates.
# Released under the GPL
#
# chkconfig: 345 85 15
# description: The KSM tuning daemon controls whether (and with what vigor) \
# ksm should ksm search duplicated pages.
# processname: ksmtuned
# config: /etc/ksmtuned.conf
# pidfile: /var/run/ksmtuned.pid
#
### BEGIN INIT INFO
# Provides: ksmtuned
# Required-Start:
# Required-Stop:
# Should-Start:
# Default-Start: 3 4 5
# Short-Description: tune the speed of ksm
# Description: The Kernel Samepage Merging control Daemon is a simple script
# that controls whether (and with what vigor) should ksm search duplicated
# memory pages.
# needs testing and ironing. contact danken@redhat.com if something breaks.
### END INIT INFO
. /etc/rc.d/init.d/functions
prog=ksmtuned
ksmtuned=/usr/sbin/ksmtuned
pidfile=${PIDFILE-/var/run/ksmtune.pid}
RETVAL=0
start() {
echo -n $"Starting $prog: "
daemon --pidfile=${pidfile} $ksmtuned
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
}
stop() {
echo -n $"Stopping $prog: "
killproc -p ${pidfile}
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
}
restart() {
stop
start
}
condrestart() {
[ -e /var/lock/subsys/$prog ] && restart || :
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p ${pidfile} $prog
RETVAL=$?
;;
restart|force-reload)
restart
;;
condrestart|try-restart)
condrestart
;;
retune)
pid=`cat ${pidfile} 2> /dev/null`
RETVAL=$?
if [ -z "$pid" ]; then
echo $"Cannot retune, service is not running."
else
kill -SIGUSR1 $pid
RETVAL=$?
fi
;;
*)
echo $"Usage: $prog {start|stop|restart|force-reload|condrestart|try-restart|status|retune|help}"
RETVAL=2
esac
exit $RETVAL

86
qemu-ga.init Normal file
View File

@ -0,0 +1,86 @@
#!/bin/bash
#
# qemu-ga: QEMU Guest Agent init script
# Author: Lubomir Rintel <lkundrak@v3.sk>
#
# chkconfig: - 80 30
# description: QEMU Guest Agents lets a virtualized guest use functionality
# provided by the host hypervisor.
# processname: qemu-ga
# config: /etc/sysconfig/qemu-ga
# pidfile: /var/run/qemu-ga.pid
#
### BEGIN INIT INFO
# Provides: qemu-ga
# Required-Start:
# Required-Stop:
# Should-Start:
# Default-Start:
# Default-Stop: 0 1 2 6
# Short-Description: QEMU Guest Agent
# Description: QEMU Guest Agents lets a virtualized guest use functionality
# provided by the host hypervisor.
### END INIT INFO
. /etc/rc.d/init.d/functions
prog=qemu-ga
qemuga=/usr/bin/qemu-ga
pidfile=${PIDFILE-/var/run/ksmtune.pid}
QEMUGA_DEV=/dev/virtio-ports/org.qemu.guest_agent.0
RETVAL=0
# Source service configuration.
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
# Do nothing if the channel is not present
[ -e "$QEMUGA_DEV" ] || exit 0
start() {
echo -n $"Starting $prog: "
daemon --pidfile=${pidfile} $qemuga --daemonize $QEMUGA_OPTS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
}
stop() {
echo -n $"Stopping $prog: "
killproc -p ${pidfile}
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
}
restart() {
stop
start
}
condrestart() {
[ -e /var/lock/subsys/$prog ] && restart || :
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p ${pidfile} $prog
RETVAL=$?
;;
restart|force-reload)
restart
;;
condrestart|try-restart)
condrestart
;;
*)
echo $"Usage: $prog {start|stop|restart|force-reload|condrestart|try-restart|status|retune|help}"
RETVAL=2
esac
exit $RETVAL

102
qemu.init Normal file
View File

@ -0,0 +1,102 @@
#!/bin/sh
#
# qemu Allow users to run non-native Linux programs by just clicking on them
# (or typing ./file.exe)
#
# chkconfig: 2345 35 98
# description: Allow users to run non-native Linux programs by just clicking \
# on them (or typing ./file.exe)
. /etc/rc.d/init.d/functions
RETVAL=0
QEMU=/usr/bin
start() {
cpu=`uname -m`
case "$cpu" in
i386|i486|i586|i686|i86pc|BePC)
cpu="i386"
;;
"Power Macintosh"|ppc|ppc64)
cpu="ppc"
;;
armv4l|armv5l)
cpu="arm"
;;
sh4)
cpu="sh4"
;;
esac
echo -n $"Registering binary handler for qemu applications"
/sbin/modprobe binfmt_misc &>/dev/null
if [ "$cpu" != i386 -a -x $QEMU/qemu-i386 -a -d /usr/qemu-i386 ] ; then
echo ":qemu-i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xff\xff\xff:$QEMU/qemu-i386:" > /proc/sys/fs/binfmt_misc/register
echo ":qemu-i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xff\xff\xff:$QEMU/qemu-i386:" > /proc/sys/fs/binfmt_misc/register
fi
if [ "$cpu" != arm -a -x $QEMU/qemu-arm -a -d /usr/qemu-arm ] ; then
echo ":qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xff\xff\xff:$QEMU/qemu-arm:" > /proc/sys/fs/binfmt_misc/register
fi
if [ "$cpu" != ppc -a -x $QEMU/qemu-ppc -a -d /usr/qemu-ppc ] ; then
echo ":ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xff\xff\xff:$QEMU/qemu-ppc:" > /proc/sys/fs/binfmt_misc/register
echo do ppc
fi
if [ "$cpu" != sparc -a -x $QEMU/qemu-sparc -a -d /usr/qemu-sparc ] ; then
echo ":qemu-sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xff\xff\xff:$QEMU/qemu-sparc:" > /proc/sys/fs/binfmt_misc/register
fi
if [ "$cpu" != sh4 -a -x $QEMU/qemu-sh4 -a -d /usr/qemu-sh4 ] ; then
echo ":qemu-sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfa\xff\xff\xff:$QEMU/qemu-sh4:" > /proc/sys/fs/binfmt_misc/register
fi
echo
}
stop() {
echo -n $"Unregistering binary handler for qemu applications"
for a in i386 i486 ppc arm sparc sh4 ] ; do
[ -r /proc/sys/fs/binfmt_misc/qemu-$a ] && echo "-1" >/proc/sys/fs/binfmt_misc/qemu-$a
done
echo
}
reload() {
stop
start
}
qemu_status() {
if ls /proc/sys/fs/binfmt_misc/qemu-* &>/dev/null; then
echo $"qemu binary format handlers are registered."
return 0
else
echo $"qemu binary format handlers are not registered."
return 3
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
qemu_status
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if qemu_status &>/dev/null; then
stop
start
fi
;;
*)
echo $"Usage: $prog {start|stop|status|restart|condrestart}"
exit 1
esac
exit $RETVAL

283
qemu.spec
View File

@ -1,3 +1,12 @@
# ===== 8< ===== HACK ===== 8< ===== HACK ===== 8< ===== HACK ===== 8< =====
# Compiler is quite resource intensive while generating debuginfo for
# certain files, # particularly sparc64-softmmu/target-sparc/translate.o and
# thus we're # very likely to run out of memory. Disable as muchx
# paralellization as we can, to make it survive the build.
%global optflags %(rpm --eval '%%{optflags}' |sed 's/-pipe//')
%global _smp_mflags %{nil}
# ===== 8< ===== HACK ===== 8< ===== HACK ===== 8< ===== HACK ===== 8< =====
# build-time settings that support --with or --without:
#
# = kvmonly =
@ -14,7 +23,70 @@
# Enable rbd support.
#
# Enable by default, except on RHEL.
#
# = systemd =
# Install systemd unit files instead of sysvinit scripts.
#
# Enabled by default, except in EPEL6.
#
# = intree_roms =
# Install non-pc (openbios and slof) firmware from QEMU tree instead of using
# separately packaged images.
#
# Disabled by default, except in EPEL6.
#
# = intree_pc_roms =
# Install pc firmware (vgabios, bios, boot roms, etc.) from QEMU tree instead
# of using separately packaged images.
#
# Disabled by default, except in EPEL6/{i686/ppc64}.
#
# = have_libfdt =
# Build with ability to inject kernel arguments in fdt on certain
# platforms.
#
# Enabled by default, except in EPEL6.
#
# = have_xfsprogs =
# Enable XFS discard support.
#
# Enabled by default, except in EPEL6/{i686,ppc64}.
#
# = have_usbredir =
# Enable usbredir support.
#
# Enabled by default, except in EPEL6/{i686,ppc64}.
#
# = separate_kvm =
# Do not build and install stuff that would colide with separately packaged KVM.
#
# Disabled by default, except in EPEL6/x86_64.
%if 0%{?rhel} == 6
# EPEL for RHEL 6
%bcond_with kvmonly # disabled
%bcond_with exclusive_x86_64 # disabled
%bcond_with rbd # disabled
%bcond_with spice # disabled
%bcond_with seccomp # disabled
%bcond_with systemd # disabled
%bcond_with have_libfdt # disabled
%bcond_with have_xfsprogs # disabled
%ifarch x86_64
%bcond_without intree_roms # enabled
%bcond_with intree_pc_roms # disabled
%bcond_without separate_kvm # enabled
%else
%bcond_without intree_roms # enabled
%bcond_without intree_pc_roms # enabled
%bcond_with separate_kvm # disabled
%endif
%ifarch %{ix86} x86_64
%bcond_without have_usbredir # enabled
%else
%bcond_with have_usbredir # disabled
%endif
%else
%if 0%{?rhel}
# RHEL-specific defaults:
%bcond_without kvmonly # enabled
@ -22,6 +94,13 @@
%bcond_with rbd # disabled
%bcond_without spice # enabled
%bcond_without seccomp # enabled
%bcond_without systemd # enabled
%bcond_with intree_roms # disabled
%bcond_with intree_pc_roms # disabled
%bcond_without have_libfdt # enabled
%bcond_without have_xfsprogs # enabled
%bcond_without have_usbredir # enabled
%bcond_with separate_kvm # disabled
%else
# General defaults:
%bcond_with kvmonly # disabled
@ -29,15 +108,28 @@
%bcond_without rbd # enabled
%bcond_without spice # enabled
%bcond_without seccomp # enabled
%bcond_without systemd # enabled
%bcond_with intree_roms # disabled
%bcond_with intree_pc_roms # disabled
%bcond_without have_libfdt # enabled
%bcond_without have_xfsprogs # enabled
%bcond_without have_usbredir # enabled
%bcond_with separate_kvm # disabled
%endif
%endif
%global SLOF_gittagdate 20120731
%if %{without separate_kvm}
%if %{with exclusive_x86_64}
%global kvm_archs x86_64
%else
%global kvm_archs %{ix86} x86_64 ppc64 s390x
%endif
%else
%global kvm_archs %{ix86} ppc64 s390x
%endif
%ifarch %{ix86} x86_64
%if %{with seccomp}
@ -60,12 +152,14 @@
%global kvm_target i386
%global need_qemu_kvm 1
%endif
%if %{without separate_kvm}
%ifarch x86_64
%global system_x86 kvm
%global kvm_package system-x86
%global kvm_target x86_64
%global need_qemu_kvm 1
%endif
%endif
%ifarch ppc64
%global system_ppc kvm
%global kvm_package system-ppc
@ -103,13 +197,15 @@
# libfdt is only needed to build ARM, Microblaze or PPC emulators
%if 0%{?system_arm:1}%{?system_microblaze:1}%{?system_ppc:1}
%if %{with have_libfdt}
%global need_fdt 1
%endif
%endif
Summary: QEMU is a FAST! processor emulator
Name: qemu
Version: 1.2.0
Release: 19%{?dist}
Release: 19%{?dist}.1
# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped
Epoch: 2
License: GPLv2+ and LGPLv2+ and BSD
@ -131,6 +227,7 @@ Source0: qemu-kvm-%{version}.tar.gz
#Source0: http://downloads.sourceforge.net/sourceforge/kvm/qemu-kvm-%{version}.tar.gz
Source1: qemu.binfmt
Source6661: qemu.init
# Loads kvm kernel modules at boot
Source2: kvm.modules
@ -140,14 +237,17 @@ Source3: 80-kvm.rules
# KSM control scripts
Source4: ksm.service
Source6664: ksm.init
Source5: ksm.sysconfig
Source6: ksmctl.c
Source7: ksmtuned.service
Source6667: ksmtuned.init
Source8: ksmtuned
Source9: ksmtuned.conf
Source10: qemu-guest-agent.service
Source11: 99-qemu-guest-agent.rules
Source66610: qemu-ga.init
# Patches queued for 1.2.1 stable
Patch0001: 0001-target-xtensa-convert-host-errno-values-to-guest.patch
@ -493,7 +593,9 @@ BuildRequires: pciutils-devel
BuildRequires: pulseaudio-libs-devel
BuildRequires: ncurses-devel
BuildRequires: libattr-devel
BuildRequires: usbredir-devel >= 0.5.2
%if %{with have_usbredir}
BuildRequires: usbredir-devel
%endif
BuildRequires: texinfo
%if 0%{?have_spice:1}
BuildRequires: spice-protocol >= 0.12.2
@ -514,7 +616,9 @@ BuildRequires: systemtap-sdt-devel
# For smartcard NSS support
BuildRequires: nss-devel
# For XFS discard support in raw-posix.c
%if %{with have_xfsprogs}
BuildRequires: xfsprogs-devel
%endif
# For VNC JPEG support
BuildRequires: libjpeg-devel
# For VNC PNG support
@ -581,7 +685,11 @@ Requires: %{name}-%{system_x86} = %{epoch}:%{version}-%{release}
%if 0%{?system_xtensa:1}
Requires: %{name}-%{system_xtensa} = %{epoch}:%{version}-%{release}
%endif
%if %{without separate_kvm}
Requires: %{name}-img = %{epoch}:%{version}-%{release}
%else
Requires: %{name}-img
%endif
%define qemudocdir %{_docdir}/%{name}
@ -632,9 +740,11 @@ Group: Development/Tools
Requires(post): /usr/bin/getent
Requires(post): /usr/sbin/groupadd
Requires(post): /usr/sbin/useradd
%if %{with systemd}
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
%endif
%description common
QEMU is a generic and open source processor emulator which achieves a good
emulation speed by using dynamic translation.
@ -644,9 +754,11 @@ This package provides the common files needed by all QEMU targets
%package guest-agent
Summary: QEMU guest agent
Group: System Environment/Daemons
%if %{with systemd}
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
%endif
%description guest-agent
QEMU is a generic and open source processor emulator which achieves a good
@ -660,20 +772,34 @@ This package does not need to be installed on the host OS.
%post guest-agent
if [ $1 -eq 1 ] ; then
# Initial installation.
%if %{with systemd}
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%else
/sbin/chkconfig --add qemu-ga
%endif
fi
%preun guest-agent
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade.
%if %{with systemd}
/bin/systemctl stop qemu-guest-agent.service > /dev/null 2>&1 || :
%else
/sbin/chkconfig --del qemu-ga
%endif
fi
%postun guest-agent
%if %{with systemd}
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall.
%if %{with systemd}
/bin/systemctl try-restart qemu-guest-agent.service >/dev/null 2>&1 || :
%else
/sbin/service qemu-ga condrestart &>/dev/null || :
%endif
fi
@ -683,8 +809,10 @@ fi
Summary: QEMU user mode emulation of qemu targets
Group: Development/Tools
Requires: %{name}-common = %{epoch}:%{version}-%{release}
%if %{with systemd}
Requires(post): systemd-units
Requires(postun): systemd-units
%endif
%description %{user}
QEMU is a generic and open source processor emulator which achieves a good
emulation speed by using dynamic translation.
@ -699,10 +827,16 @@ Group: Development/Tools
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: kvm = 85
Obsoletes: kvm < 85
Requires: vgabios >= 0.6c-2
Requires: seabios-bin >= 0.6.0-2
%if %{without intree_pc_roms}
Requires: vgabios
Requires: seabios
Requires: sgabios-bin
%if 0%{?rhel} > 0 && 0%{?rhel} < 7
Requires: gpxe-roms-qemu
%else
Requires: ipxe-roms-qemu
%endif
%endif
%if 0%{?have_seccomp:1}
Requires: libseccomp >= 1.0.0
%endif
@ -841,7 +975,9 @@ This package provides the system emulator for SH4 boards.
Summary: QEMU system emulator for SPARC
Group: Development/Tools
Requires: %{name}-common = %{epoch}:%{version}-%{release}
%if %{without intree_roms}
Requires: openbios
%endif
%description %{system_sparc}
QEMU is a generic and open source processor emulator which achieves a good
emulation speed by using dynamic translation.
@ -854,8 +990,10 @@ This package provides the system emulator for SPARC and SPARC64 systems.
Summary: QEMU system emulator for PPC
Group: Development/Tools
Requires: %{name}-common = %{epoch}:%{version}-%{release}
%if %{without intree_roms}
Requires: openbios
Requires: SLOF = 0.1.git%{SLOF_gittagdate}
%endif
%description %{system_ppc}
QEMU is a generic and open source processor emulator which achieves a good
emulation speed by using dynamic translation.
@ -1327,11 +1465,21 @@ gcc %{SOURCE6} -O2 -g -o ksmctl
%define _udevdir /lib/udev/rules.d
%if %{with systemd}
install -D -p -m 0755 %{SOURCE4} $RPM_BUILD_ROOT/lib/systemd/system/ksm.service
%else
install -D -p -m 0755 %{SOURCE6664} $RPM_BUILD_ROOT%{_initddir}/ksm
%endif
install -D -p -m 0644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ksm
%if %{with systemd}
install -D -p -m 0755 ksmctl $RPM_BUILD_ROOT/lib/systemd/ksmctl
%endif
%if %{with systemd}
install -D -p -m 0755 %{SOURCE7} $RPM_BUILD_ROOT/lib/systemd/system/ksmtuned.service
%else
install -D -p -m 0755 %{SOURCE6667} $RPM_BUILD_ROOT%{_initddir}/ksmtuned
%endif
install -D -p -m 0755 %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}/ksmtuned
install -D -p -m 0644 %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/ksmtuned.conf
@ -1361,16 +1509,21 @@ rm $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}.stp
%endif
chmod -x ${RPM_BUILD_ROOT}%{_mandir}/man1/*
%if %{without systemd}
install -D -p -m 0755 %{SOURCE6661} $RPM_BUILD_ROOT%{_initddir}/qemu
%endif
install -D -p -m 0644 -t ${RPM_BUILD_ROOT}%{qemudocdir} Changelog README TODO COPYING COPYING.LIB LICENSE
install -D -p -m 0644 qemu.sasl $RPM_BUILD_ROOT%{_sysconfdir}/sasl2/qemu.conf
%if %{without intree_roms}
# Provided by package openbios
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/openbios-ppc
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/openbios-sparc32
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/openbios-sparc64
# Provided by package SLOF
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/slof.bin
%endif
# Remove possibly unpackaged files. Unlike others that are removed
# unconditionally, these firmware files are still distributed as a binary
@ -1392,6 +1545,7 @@ rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/spapr-rtas.bin
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/s390-zipl.rom
%endif
%if %{without intree_pc_roms}
# Provided by package ipxe
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/pxe*rom
# Provided by package vgabios
@ -1410,6 +1564,7 @@ pxe_link() {
}
pxe_link e1000 8086100e
pxe_link eepro100 80861209
pxe_link ne2k_pci 10ec8029
pxe_link pcnet 10222000
pxe_link rtl8139 10ec8139
@ -1427,7 +1582,9 @@ rom_link ../vgabios/VGABIOS-lgpl-latest.vmware.bin vgabios-vmware.bin
rom_link ../seabios/bios.bin bios.bin
rom_link ../sgabios/sgabios.bin sgabios.bin
%endif
%endif
%if %{with systemd}
%if 0%{?user:1}
mkdir -p $RPM_BUILD_ROOT%{_exec_prefix}/lib/binfmt.d
for i in dummy \
@ -1476,6 +1633,26 @@ mkdir -p $RPM_BUILD_ROOT%{_unitdir}
mkdir -p $RPM_BUILD_ROOT%{_udevdir}
install -m 0644 %{SOURCE10} $RPM_BUILD_ROOT%{_unitdir}
install -m 0644 %{SOURCE11} $RPM_BUILD_ROOT%{_udevdir}
%else
# For the qemu-guest-agent subpackage install the service
mkdir -p $RPM_BUILD_ROOT%{_initddir}
install -D -p -m 0755 %{SOURCE66610} $RPM_BUILD_ROOT%{_initddir}/qemu-ga
%endif
%if %{with separate_kvm}
rm $RPM_BUILD_ROOT%{_bindir}/qemu-img
rm $RPM_BUILD_ROOT%{_bindir}/qemu-io
rm $RPM_BUILD_ROOT%{_bindir}/vscclient
rm $RPM_BUILD_ROOT%{_mandir}/man1/qemu-img.1*
rm $RPM_BUILD_ROOT%{_bindir}/qemu-ga
%if %{with systemd}
rm $RPM_BUILD_ROOT%{_unitdir}/qemu-guest-agent.service
rm $RPM_BUILD_ROOT%{_udevdir}/99-qemu-guest-agent.rules
%else
rm $RPM_BUILD_ROOT%{_initddir}/qemu-ga
%endif
%endif
%check
make check
@ -1488,11 +1665,17 @@ sh %{_sysconfdir}/sysconfig/modules/kvm.modules || :
udevadm trigger --sysname-match=kvm || :
%endif
%if %{without separate_kvm}
%post common
if [ $1 -eq 1 ] ; then
# Initial installation
%if %{with systemd}
/bin/systemctl enable ksm.service >/dev/null 2>&1 || :
/bin/systemctl enable ksmtuned.service >/dev/null 2>&1 || :
%else
/sbin/chkconfig --add ksm
/sbin/chkconfig --add ksmtuned
%endif
fi
getent group kvm >/dev/null || groupadd -g 36 -r kvm
@ -1504,27 +1687,60 @@ getent passwd qemu >/dev/null || \
%preun common
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
%if %{with systemd}
/bin/systemctl --no-reload disable ksmtuned.service > /dev/null 2>&1 || :
/bin/systemctl --no-reload disable ksm.service > /dev/null 2>&1 || :
/bin/systemctl stop ksmtuned.service > /dev/null 2>&1 || :
/bin/systemctl stop ksm.service > /dev/null 2>&1 || :
%else
/sbin/service ksmtuned stop &>/dev/null || :
/sbin/chkconfig --del ksmtuned
/sbin/service ksm stop &>/dev/null || :
/sbin/chkconfig --del ksm
%endif
fi
%postun common
%if %{with systemd}
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
%if %{with systemd}
/bin/systemctl try-restart ksmtuned.service >/dev/null 2>&1 || :
/bin/systemctl try-restart ksm.service >/dev/null 2>&1 || :
%else
/sbin/service ksm condrestart &>/dev/null || :
/sbin/service ksmtuned condrestart &>/dev/null || :
%endif
fi
%endif
%if 0%{?user:1}
%post %{user}
%if %{with systemd}
/bin/systemctl --system try-restart systemd-binfmt.service &>/dev/null || :
%else
/sbin/chkconfig --add qemu
%endif
%preun user
if [ $1 -eq 0 ]; then
%if %{without systemd}
/sbin/service qemu stop &>/dev/null || :
/sbin/chkconfig --del qemu
%endif
fi
%postun %{user}
%if %{with systemd}
/bin/systemctl --system try-restart systemd-binfmt.service &>/dev/null || :
%else
if [ $1 -ge 1 ]; then
/sbin/service qemu condrestart &>/dev/null || :
fi
%endif
%endif
%global kvm_files \
@ -1566,25 +1782,60 @@ fi
%{_bindir}/virtfs-proxy-helper
%{_libexecdir}/qemu-bridge-helper
%config(noreplace) %{_sysconfdir}/sasl2/qemu.conf
%if %{without separate_kvm}
%if %{with systemd}
/lib/systemd/system/ksm.service
/lib/systemd/ksmctl
%else
%{_initddir}/ksm
%endif
%config(noreplace) %{_sysconfdir}/sysconfig/ksm
%if %{with systemd}
/lib/systemd/system/ksmtuned.service
%else
%{_initddir}/ksmtuned
%endif
%{_sbindir}/ksmtuned
%config(noreplace) %{_sysconfdir}/ksmtuned.conf
%else
%if %{with systemd}
%exclude /lib/systemd/system/ksm.service
%exclude /lib/systemd/ksmctl
%else
%exclude %{_initddir}/ksm
%endif
%config(noreplace) %{_sysconfdir}/sysconfig/ksm
%if %{with systemd}
%exclude /lib/systemd/system/ksmtuned.service
%else
%exclude %{_initddir}/ksmtuned
%endif
%exclude %{_sbindir}/ksmtuned
%exclude %config(noreplace) %{_sysconfdir}/ksmtuned.conf
%endif
%dir %{_sysconfdir}/qemu
%if %{without separate_kvm}
%files guest-agent
%defattr(-,root,root,-)
%doc COPYING README
%{_bindir}/qemu-ga
%if %{with systemd}
%{_unitdir}/qemu-guest-agent.service
%{_udevdir}/99-qemu-guest-agent.rules
%else
%{_initddir}/qemu-ga
%endif
%endif
%if 0%{?user:1}
%files %{user}
%defattr(-,root,root)
%if %{with systemd}
%{_exec_prefix}/lib/binfmt.d/qemu-*.conf
%else
%{_initddir}/qemu
%endif
%{_bindir}/qemu-i386
%{_bindir}/qemu-x86_64
%{_bindir}/qemu-alpha
@ -1655,14 +1906,17 @@ fi
%{_datadir}/%{name}/pxe-pcnet.rom
%{_datadir}/%{name}/pxe-rtl8139.rom
%{_datadir}/%{name}/pxe-ne2k_pci.rom
%{_datadir}/%{name}/pxe-eepro100.rom
%{_datadir}/%{name}/cpus-x86_64.conf
%{_datadir}/%{name}/qemu-icon.bmp
%config(noreplace) %{_sysconfdir}/qemu/target-x86_64.conf
%if %{without separate_kvm}
%ifarch %{ix86} x86_64
%{?kvm_files:}
%{?qemu_kvm_files:}
%endif
%endif
%endif
%ifarch %{kvm_archs}
%files kvm-tools
@ -1764,6 +2018,10 @@ fi
%{_bindir}/qemu-system-sparc64
%{_datadir}/systemtap/tapset/qemu-system-sparc.stp
%{_datadir}/systemtap/tapset/qemu-system-sparc64.stp
%if %{with intree_roms}
%{_datadir}/%{name}/openbios-sparc32
%{_datadir}/%{name}/openbios-sparc64
%endif
%endif
%if 0%{?system_ppc:1}
@ -1776,6 +2034,10 @@ fi
%{_datadir}/systemtap/tapset/qemu-system-ppc.stp
%{_datadir}/systemtap/tapset/qemu-system-ppc64.stp
%{_datadir}/systemtap/tapset/qemu-system-ppcemb.stp
%if %{with intree_roms}
%{_datadir}/%{name}/openbios-ppc
%{_datadir}/%{name}/slof.bin
%endif
%endif
%{_datadir}/%{name}/bamboo.dtb
%{_datadir}/%{name}/ppc_rom.bin
@ -1802,14 +2064,27 @@ fi
%{_datadir}/systemtap/tapset/qemu-system-xtensaeb.stp
%endif
%if %{without separate_kvm}
%files img
%defattr(-,root,root)
%{_bindir}/qemu-img
%{_bindir}/qemu-io
%{_bindir}/vscclient
%{_mandir}/man1/qemu-img.1*
%endif
%changelog
* Thu Nov 11 2012 Lubomir Rintel <lkundrak@v3.sk> - 2:1.2.0-19.1
- Add EPEL 6 support
- Allow building a package that is able to coexist with el6's kvm package
- Require gpxe-roms-qemu in EPEL6
- Allow builds without usbredir
- Allow builds without xfsprogs
- Do not stick certain dependencies to exact revisions
- Allow building without libfdt
- Allow builds with intree firmware
- Bring back sysvinit support
* Thu Nov 1 2012 Hans de Goede <hdegoede@redhat.com> - 2:1.2.0-19
- Sync spice patches with upstream, minor bugfixes and set the qxl pci
device revision to 4 by default, so that guests know they can use