xen/xen.spec

1423 lines
48 KiB
RPMSpec

#
# spec file for package xen
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: xen
ExclusiveArch: %ix86 x86_64
%define xvers 4.2
%define xvermaj 4
%define changeset 26064
%define xen_build_dir xen-4.2.2-testing
%define with_kmp 1
%define with_stubdom 1
# EFI requires gcc46 or newer
# its available in 12.1 or >= sles11sp2
%if %suse_version == 1210 || %suse_version == 1110
%define with_gcc46 1
%else
%define with_gcc46 0
%endif
%ifarch x86_64
%define with_dom0_support 1
%else
%define with_dom0_support 0
%endif
%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
%if %suse_version > 1140
%define with_xend 1
%else
%define with_xend 1
%endif
BuildRequires: LibVNCServer-devel
BuildRequires: SDL-devel
BuildRequires: automake
BuildRequires: bin86
BuildRequires: curl-devel
BuildRequires: dev86
BuildRequires: fdupes
BuildRequires: glib2-devel
BuildRequires: graphviz
BuildRequires: latex2html
BuildRequires: libbz2-devel
BuildRequires: libjpeg-devel
BuildRequires: libuuid-devel
BuildRequires: libxml2-devel
BuildRequires: libyajl-devel
BuildRequires: ncurses-devel
BuildRequires: openssl
BuildRequires: openssl-devel
BuildRequires: pciutils-devel
BuildRequires: python-devel
BuildRequires: texinfo
BuildRequires: transfig
%if %suse_version >= 1120
BuildRequires: xz-devel
%endif
%if %suse_version <= 1110
BuildRequires: pmtools
%else
BuildRequires: acpica
%endif
%if %suse_version >= 1030
BuildRequires: texlive
BuildRequires: texlive-latex
%if %suse_version > 1220
BuildRequires: texlive-courier
BuildRequires: texlive-dvips
BuildRequires: texlive-helvetic
BuildRequires: texlive-psnfss
BuildRequires: texlive-times
BuildRequires: tex(a4.sty)
BuildRequires: tex(a4wide.sty)
BuildRequires: tex(fancyhdr.sty)
BuildRequires: tex(parskip.sty)
BuildRequires: tex(setspace.sty)
%endif
%else
BuildRequires: te_ams
BuildRequires: te_latex
BuildRequires: tetex
%endif
%ifarch x86_64
%if %{?with_gcc46}0
BuildRequires: gcc46
BuildRequires: libgcc46
BuildRequires: libgcc46-32bit
%endif
BuildRequires: gcc-32bit
BuildRequires: gcc43-32bit
BuildRequires: glibc-32bit
BuildRequires: glibc-devel-32bit
%define max_cpus 256
%define pae_enabled n
%else
%define max_cpus 32
%define pae_enabled y
%endif
BuildRequires: glibc-devel
%if %{?with_kmp}0
BuildRequires: kernel-source
BuildRequires: kernel-syms
BuildRequires: module-init-tools
%if %suse_version < 1220
BuildRequires: xorg-x11
%else
BuildRequires: lndir
%endif
%endif
Version: 4.2.2_01
Release: 0
PreReq: %insserv_prereq %fillup_prereq
Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel)
License: GPL-2.0+
Group: System/Kernel
Source0: xen-4.2.2-testing-src.tar.bz2
Source1: stubdom.tar.bz2
Source2: qemu-xen-traditional-dir-remote.tar.bz2
Source3: qemu-xen-dir-remote.tar.bz2
Source4: seabios-dir-remote.tar.bz2
Source5: ipxe.tar.bz2
Source6: xen-utils-0.1.tar.bz2
Source10: README.SuSE
Source11: boot.xen
Source12: boot.local.xenU
Source13: init.xend
Source14: init.xendomains
Source15: logrotate.conf
Source16: domUloader.py
Source17: xmexample.domUloader
Source18: xmexample.disks
Source19: block-nbd
Source20: block-iscsi
Source21: block-npiv-common.sh
Source22: block-npiv
Source23: block-npiv-vport
Source24: xmclone.sh
Source25: xend-relocation.sh
Source26: init.xen_loop
%if %{?with_kmp}0
Source27: xen_pvdrivers.conf
Source28: kmp_filelist
%endif
# Xen API remote authentication sources
Source29: block-dmmd
Source30: etc_pam.d_xen-api
Source31: xenapiusers
# sysconfig hook script for Xen
Source32: xen-updown.sh
# Firewall service file for xend relocation server
Source33: xend-relocation-server.fw
# init script and sysconf file for pciback
Source34: init.pciback
Source35: sysconfig.pciback
Source36: xnloader.py
Source99: baselibs.conf
# http://xenbits.xensource.com/ext/xenalyze
Source20000: xenalyze.hg.tar.bz2
# Upstream patches
Patch25861: 25861-x86-early-fixmap.patch
Patch25862: 25862-sercon-non-com.patch
Patch25863: 25863-sercon-ehci-dbgp.patch
Patch25864: 25864-sercon-unused.patch
Patch25866: 25866-sercon-ns16550-pci-irq.patch
Patch25867: 25867-sercon-ns16550-parse.patch
Patch25874: 25874-x86-EFI-chain-cfg.patch
Patch25909: 25909-xenpm-consistent.patch
Patch25920: 25920-x86-APICV-enable.patch
Patch25921: 25921-x86-APICV-delivery.patch
Patch25922: 25922-x86-APICV-x2APIC.patch
Patch25952: 25952-x86-MMIO-remap-permissions.patch
Patch25957: 25957-x86-TSC-adjust-HVM.patch
Patch25958: 25958-x86-TSC-adjust-sr.patch
Patch25959: 25959-x86-TSC-adjust-expose.patch
Patch25975: 25975-x86-IvyBridge.patch
Patch26077: 26077-stubdom_fix_compile_errors_in_grub.patch
Patch26078: 26078-hotplug-Linux_remove_hotplug_support_rely_on_udev_instead.patch
Patch26079: 26079-hotplug-Linux_close_lockfd_after_lock_attempt.patch
Patch26081: 26081-stubdom_fix_rpmlint_warning_spurious-executable-perm.patch
Patch26082: 26082-blktap2-libvhd_fix_rpmlint_warning_spurious-executable-perm.patch
Patch26083: 26083-blktap_fix_rpmlint_warning_spurious-executable-perm.patch
Patch26084: 26084-hotplug_install_hotplugpath.sh_as_data_file.patch
Patch26085: 26085-stubdom_install_stubdompath.sh_as_data_file.patch
Patch26086: 26086-hotplug-Linux_correct_sysconfig_tag_in_xendomains.patch
Patch26087: 26087-hotplug-Linux_install_sysconfig_files_as_data_files.patch
Patch26114: 26114-pygrub-list-entries.patch
Patch26129: 26129-ACPI-BGRT-invalidate.patch
Patch26133: 26133-IOMMU-defer-BM-disable.patch
Patch26189: 26189-xenstore-chmod.patch
Patch26262: 26262-x86-EFI-secure-shim.patch
Patch26324: 26324-IOMMU-assign-params.patch
Patch26325: 26325-IOMMU-add-remove-params.patch
Patch26326: 26326-VT-d-context-map-params.patch
Patch26327: 26327-AMD-IOMMU-flush-params.patch
Patch26328: 26328-IOMMU-pdev-type.patch
Patch26329: 26329-IOMMU-phantom-dev.patch
Patch26330: 26330-VT-d-phantom-MSI.patch
Patch26331: 26331-IOMMU-phantom-dev-quirk.patch
Patch26341: 26341-hvm-firmware-passthrough.patch
Patch26342: 26342-hvm-firmware-passthrough.patch
Patch26343: 26343-hvm-firmware-passthrough.patch
Patch26344: 26344-hvm-firmware-passthrough.patch
Patch26369: 26369-libxl-devid.patch
Patch26370: 26370-libxc-x86-initial-mapping-fit.patch
Patch26372: 26372-tools-paths.patch
Patch26404: 26404-x86-forward-both-NMI-kinds.patch
Patch26418: 26418-x86-trampoline-consider-multiboot.patch
Patch26532: 26532-AMD-IOMMU-phantom-MSI.patch
Patch26547: 26547-tools-xc_fix_logic_error_in_stdiostream_progress.patch
Patch26548: 26548-tools-xc_handle_tty_output_differently_in_stdiostream_progress.patch
Patch26549: 26549-tools-xc_turn_XCFLAGS__into_shifts.patch
Patch26550: 26550-tools-xc_restore_logging_in_xc_save.patch
Patch26551: 26551-tools-xc_log_pid_in_xc_save-xc_restore_output.patch
Patch26554: 26554-hvm-firmware-passthrough.patch
Patch26555: 26555-hvm-firmware-passthrough.patch
Patch26556: 26556-hvm-firmware-passthrough.patch
Patch26576: 26576-x86-APICV-migration.patch
Patch26577: 26577-x86-APICV-x2APIC.patch
Patch26675: 26675-tools-xentoollog_update_tty_detection_in_stdiostream_progress.patch
Patch26891: 26891-x86-S3-Fix-cpu-pool-scheduling-after-suspend-resume.patch
Patch26902: 26902-x86-EFI-pass-boot-services-variable-info-to-runtime-code.patch
Patch26930: 26930-x86-EFI-fix-runtime-call-status-for-compat-mode-Dom0.patch
Patch4501: CVE-2013-1918-xsa45-1-vcpu-destroy-pagetables-preemptible.patch
Patch4502: CVE-2013-1918-xsa45-2-new-guest-cr3-preemptible.patch
Patch4503: CVE-2013-1918-xsa45-3-new-user-base-preemptible.patch
Patch4504: CVE-2013-1918-xsa45-4-vcpu-reset-preemptible.patch
Patch4505: CVE-2013-1918-xsa45-5-set-info-guest-preemptible.patch
Patch4506: CVE-2013-1918-xsa45-6-unpin-preemptible.patch
Patch4507: CVE-2013-1918-xsa45-7-mm-error-paths-preemptible.patch
Patch4508: CVE-2013-1918-xsa45-followup.patch
Patch48: CVE-2013-1922-xsa48.patch
Patch49: CVE-2013-1952-xsa49.patch
Patch88: xen.migrate.tools-xc_print_messages_from_xc_save_with_xc_report.patch
Patch89: xen.migrate.tools-xc_document_printf_calls_in_xc_restore.patch
Patch90: xen.migrate.tools-xc_rework_xc_save.cswitch_qemu_logdirty.patch
Patch91: xen.migrate.tools_set_migration_constraints_from_cmdline.patch
Patch92: xen.migrate.tools_add_xm_migrate_--log_progress_option.patch
Patch93: xen.migrate.tools-xend_move_assert_to_exception_block.patch
Patch94: xen.migrate.tools-libxc_print_stats_if_migration_is_aborted.patch
Patch95: xen.migrate.tools_set_number_of_dirty_pages_during_migration.patch
# Upstream qemu patches
Patch100: VNC-Support-for-ExtendedKeyEvent-client-message.patch
# Our patches
Patch301: xend-config.diff
Patch302: xen-destdir.diff
Patch304: xen-changeset.diff
Patch305: xen-paths.diff
Patch306: xen-xmexample.diff
Patch307: xen-xmexample-vti.diff
Patch310: xen-fixme-doc.diff
Patch311: xen-domUloader.diff
Patch312: xen-no-dummy-nfs-ip.diff
Patch313: serial-split.patch
Patch314: xen-xm-top-needs-root.diff
Patch315: xen-max-free-mem.diff
Patch322: bridge-opensuse.patch
Patch323: bridge-vlan.diff
Patch324: bridge-bonding.diff
Patch325: bridge-record-creation.patch
Patch327: udev-rules.patch
Patch328: vif-route-ifup.patch
Patch329: network-nat-open-SuSEfirewall2-FORWARD.patch
Patch340: xen-hvm-default-bridge.diff
Patch341: xen-hvm-default-pae.diff
Patch342: libxen_permissive.patch
Patch343: xenapi-console-protocol.patch
Patch344: xen-disable-qemu-monitor.diff
Patch345: qemu-security-etch1.diff
Patch350: cdrom-removable.patch
Patch351: xend-core-dump-loc.diff
Patch352: blktap.patch
Patch353: xen-api-auth.patch
Patch354: xen-qemu-iscsi-fix.patch
Patch355: ioemu-vnc-resize.patch
Patch356: ioemu-debuginfo.patch
Patch357: vif-bridge-no-iptables.patch
Patch358: xenconsole-no-multiple-connections.patch
# Needs to go upstream
Patch370: checkpoint-rename.patch
Patch371: xm-save-check-file.patch
Patch372: xm-create-xflag.patch
Patch373: xend-sysconfig.patch
Patch374: domu-usb-controller.patch
Patch375: usb-list.patch
Patch376: xend-devid-or-name.patch
Patch377: suspend_evtchn_lock.patch
Patch378: log-guest-console.patch
Patch379: xend-migration-domname-fix.patch
Patch380: xm-create-maxmem.patch
Patch381: vif-bridge-tap-fix.patch
Patch382: xend-cpuid.patch
# ioemu part of blktap patch series
Patch410: ioemu-blktap-fv-init.patch
Patch411: ioemu-blktap-image-format.patch
Patch412: build-tapdisk-ioemu.patch
Patch413: tapdisk-ioemu-logfile.patch
Patch414: ioemu-blktap-zero-size.patch
Patch415: tapdisk-ioemu-shutdown-fix.patch
Patch420: blktapctrl-default-to-ioemu.patch
Patch421: ioemu-blktap-barriers.patch
# Other bug fixes or features
Patch423: bdrv_open2_fix_flags.patch
Patch424: bdrv_open2_flags_2.patch
Patch425: ioemu-bdrv-open-CACHE_WB.patch
Patch426: ioemu-7615-qcow2-fix-alloc_cluster_link_l2.patch
Patch427: xen-ioemu-hvm-pv-support.diff
Patch428: qemu-dm-segfault.patch
Patch429: hibernate.patch
Patch430: del_usb_xend_entry.patch
Patch431: capslock_enable.patch
Patch433: multi-xvdp.patch
Patch434: check_device_status.patch
Patch435: change_home_server.patch
Patch436: altgr_2.patch
Patch438: stdvga-cache.patch
Patch439: minios-fixups.patch
Patch440: bdrv_default_rwflag.patch
Patch442: xen-minimum-restart-time.patch
Patch446: xend-disable-internal-logrotate.patch
Patch447: xend-config-enable-dump-comment.patch
Patch448: change-vnc-passwd.patch
Patch449: kernel-boot-hvm.patch
Patch450: ioemu-watchdog-support.patch
Patch451: ioemu-watchdog-linkage.patch
Patch452: ioemu-watchdog-ib700-timer.patch
Patch453: tools-watchdog-support.patch
Patch454: xend-console-port-restore.patch
Patch456: xend-vcpu-affinity-fix.patch
Patch457: xen-cpupool-xl-config-format.patch
Patch458: ipxe-enable-nics.patch
Patch459: blktap-close-fifos.patch
Patch460: blktap-disable-debug-printf.patch
Patch461: xen-migration-bridge-check.patch
Patch462: pygrub-netware-xnloader.patch
Patch463: xen-managed-pci-device.patch
Patch464: xend-hvm-firmware-passthrough.patch
Patch465: xend-cpuinfo-model-name.patch
Patch466: xen-glibc217.patch
# Jim's domain lock patch
Patch480: xend-domain-lock.patch
Patch481: xend-domain-lock-sfex.patch
# Hypervisor and PV driver Patches
Patch500: 32on64-extra-mem.patch
Patch501: x86-ioapic-ack-default.patch
Patch502: x86-cpufreq-report.patch
Patch503: x86-dom-print.patch
Patch504: pvdrv-import-shared-info.patch
Patch505: x86-extra-trap-info.patch
Patch506: pvdrv_emulation_control.patch
Patch507: blktap-pv-cdrom.patch
Patch511: supported_module.diff
Patch512: magic_ioport_compat.patch
Patch513: xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch
Patch650: disable_emulated_device.diff
Patch651: ioemu-disable-scsi.patch
Patch652: ioemu-disable-emulated-ide-if-pv.patch
Patch700: hv_extid_compatibility.patch
Patch800: xenpaging.autostart.patch
Patch801: xenpaging.doc.patch
Patch802: xenpaging.qemu.flush-cache.patch
# Build patch
Patch99998: tmp-initscript-modprobe.patch
Patch99999: tmp_build.patch
Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define pyver %(python -c "import sys; print sys.version[:3]")
%if %{?with_kmp}0
%suse_kernel_module_package -n xen um xen -f kmp_filelist
%endif
%description
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
This package contains the Xen Hypervisor. (tm)
Modern computers are sufficiently powerful to use virtualization to
present the illusion of many smaller virtual machines (VMs), each
running a separate operating system instance. Successful partitioning
of a machine to support the concurrent execution of multiple operating
systems poses several challenges. Firstly, virtual machines must be
isolated from one another: It is not acceptable for the execution of
one to adversely affect the performance of another. This is
particularly true when virtual machines are owned by mutually
untrusting users. Secondly, it is necessary to support a variety of
different operating systems to accommodate the heterogeneity of popular
applications. Thirdly, the performance overhead introduced by
virtualization should be small.
Xen uses a technique called paravirtualization: The guest OS is
modified, mainly to enhance performance.
The Xen hypervisor (microkernel) does not provide device drivers for
your hardware (except for CPU and memory). This job is left to the
kernel that's running in domain 0. Thus the domain 0 kernel is
privileged; it has full hardware access. It's started immediately after
Xen starts up. Other domains have no access to the hardware; instead
they use virtual interfaces that are provided by Xen (with the help of
the domain 0 kernel).
Xen does support booting other Operating Systems; ports of NetBSD
(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich)
exist. A port of Windows XP was developed for an earlier version of
Xen, but is not available for release due to license restrictions.
In addition to this package you need to install the kernel-xen and
xen-tools to use Xen. Xen 3 also supports running unmodified guests
using full virtualization, if appropriate hardware is present. Install
xen-tools-ioemu if you want to use this.
[Hypervisor is a trademark of IBM]
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Mark Williamson <mark.williamson@cl.cam.ac.uk>
Ewan Mellor <ewan@xensource.com>
...
%package libs
Summary: Xen Virtualization: Libraries
Group: System/Kernel
#Requires: xen = %{version}
%description libs
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
This package contains the libraries used to interact with the Xen
virtual machine monitor.
Modern computers are sufficiently powerful to use virtualization to
present the illusion of many smaller virtual machines (VMs), each
running a separate operating system instance. Successful partitioning
of a machine to support the concurrent execution of multiple operating
systems poses several challenges. Firstly, virtual machines must be
isolated from one another: It is not acceptable for the execution of
one to adversely affect the performance of another. This is
particularly true when virtual machines are owned by mutually
untrusting users. Secondly, it is necessary to support a variety of
different operating systems to accommodate the heterogeneity of popular
applications. Thirdly, the performance overhead introduced by
virtualization should be small.
Xen uses a technique called paravirtualization: The guest OS is
modified, mainly to enhance performance.
The Xen hypervisor (microkernel) does not provide device drivers for
your hardware (except for CPU and memory). This job is left to the
kernel that's running in domain 0. Thus the domain 0 kernel is
privileged; it has full hardware access. It's started immediately after
Xen starts up. Other domains have no access to the hardware; instead
they use virtual interfaces that are provided by Xen (with the help of
the domain 0 kernel).
Xen does support booting other Operating Systems; ports of NetBSD
(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich)
exist. A port of Windows XP was developed for an earlier version of
Xen, but is not available for release due to license restrictions.
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%if %{?with_dom0_support}0
%package tools
Summary: Xen Virtualization: Control tools for domain 0
Group: System/Kernel
Requires: bridge-utils
Requires: multipath-tools
Requires: python
Requires: python-curses
Requires: python-lxml
Requires: python-openssl
Requires: python-pam
Requires: python-xml
Requires: xen-libs = %{version}
# subpackage existed in 10.3
Provides: xen-tools-ioemu = %{version}
Obsoletes: xen-tools-ioemu < %{version}
%description tools
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
This package contains the control tools that allow you to start, stop,
migrate, and manage virtual machines.
Modern computers are sufficiently powerful to use virtualization to
present the illusion of many smaller virtual machines (VMs), each
running a separate operating system instance. Successful partitioning
of a machine to support the concurrent execution of multiple operating
systems poses several challenges. Firstly, virtual machines must be
isolated from one another: It is not acceptable for the execution of
one to adversely affect the performance of another. This is
particularly true when virtual machines are owned by mutually
untrusting users. Secondly, it is necessary to support a variety of
different operating systems to accommodate the heterogeneity of popular
applications. Thirdly, the performance overhead introduced by
virtualization should be small.
Xen uses a technique called paravirtualization: The guest OS is
modified, mainly to enhance performance.
The Xen hypervisor (microkernel) does not provide device drivers for
your hardware (except for CPU and memory). This job is left to the
kernel that's running in domain 0. Thus the domain 0 kernel is
privileged; it has full hardware access. It's started immediately after
Xen starts up. Other domains have no access to the hardware; instead
they use virtual interfaces that are provided by Xen (with the help of
the domain 0 kernel).
Xen does support booting other Operating Systems; ports of NetBSD
(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich)
exist. A port of Windows XP was developed for an earlier version of
Xen, but is not available for release due to license restrictions.
In addition to this package you need to install kernel-xen and xen to
use Xen.
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%endif
%package tools-domU
Summary: Xen Virtualization: Control tools for domain U
Group: System/Kernel
Conflicts: xen-tools
%description tools-domU
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
This package contains tools that allow unprivileged domains to query
the virtualized environment.
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%package devel
Summary: Xen Virtualization: Headers and libraries for development
Group: System/Kernel
Requires: xen-libs = %{version}
%description devel
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
This package contains the libraries and header files needed to create
tools to control virtual machines.
Modern computers are sufficiently powerful to use virtualization to
present the illusion of many smaller virtual machines (VMs), each
running a separate operating system instance. Successful partitioning
of a machine to support the concurrent execution of multiple operating
systems poses several challenges. Firstly, virtual machines must be
isolated from one another: It is not acceptable for the execution of
one to adversely affect the performance of another. This is
particularly true when virtual machines are owned by mutually
untrusting users. Secondly, it is necessary to support a variety of
different operating systems to accommodate the heterogeneity of popular
applications. Thirdly, the performance overhead introduced by
virtualization should be small.
Xen uses a technique called paravirtualization: The guest OS is
modified, mainly to enhance performance.
The Xen hypervisor (microkernel) does not provide device drivers for
your hardware (except for CPU and memory). This job is left to the
kernel that's running in domain 0. Thus the domain 0 kernel is
privileged; it has full hardware access. It's started immediately after
Xen starts up. Other domains have no access to the hardware; instead
they use virtual interfaces that are provided by Xen (with the help of
the domain 0 kernel).
Xen does support booting other Operating Systems; ports of NetBSD
(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich)
exist. A port of Windows XP was developed for an earlier version of
Xen, but is not available for release due to license restrictions.
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%if %{?with_kmp}0
%package KMP
Summary: Xen para-virtual device drivers for fully virtualized guests
Group: System/Kernel
Conflicts: xen
%description KMP
Xen para-virtual device drivers for fully virtualized guests
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
This package contains the libraries and header files needed to create
tools to control virtual machines.
Modern computers are sufficiently powerful to use virtualization to
present the illusion of many smaller virtual machines (VMs), each
running a separate operating system instance. Successful partitioning
of a machine to support the concurrent execution of multiple operating
systems poses several challenges. Firstly, virtual machines must be
isolated from one another: It is not acceptable for the execution of
one to adversely affect the performance of another. This is
particularly true when virtual machines are owned by mutually
untrusting users. Secondly, it is necessary to support a variety of
different operating systems to accommodate the heterogeneity of popular
applications. Thirdly, the performance overhead introduced by
virtualization should be small.
Xen uses a technique called paravirtualization: The guest OS is
modified, mainly to enhance performance.
The Xen hypervisor (microkernel) does not provide device drivers for
your hardware (except for CPU and memory). This job is left to the
kernel that's running in domain 0. Thus the domain 0 kernel is
privileged; it has full hardware access. It's started immediately after
Xen starts up. Other domains have no access to the hardware; instead
they use virtual interfaces that are provided by Xen (with the help of
the domain 0 kernel).
Xen does support booting other Operating Systems; ports of NetBSD
(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich)
exist. A port of Windows XP was developed for an earlier version of
Xen, but is not available for release due to license restrictions.
%endif
%if %{?with_dom0_support}0
%package doc-html
Summary: Xen Virtualization: HTML documentation
Group: Documentation/HTML
%description doc-html
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
xen-doc-html contains the online documentation in HTML format. Point
your browser at file:/usr/share/doc/packages/xen/html/
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%package doc-pdf
Summary: Xen Virtualization: PDF documentation
Group: Documentation/Other
%description doc-pdf
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
xen-doc-pdf contains the online documentation in PDF format. Use
xpdf/kpdf/gpdf/gv/... to read the files in
/usr/share/doc/packages/xen/pdf/
Authors
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%endif
%prep
%setup -q -n %xen_build_dir -a 1 -a 2 -a 3 -a 4 -a 5 -a 20000
tar xfj %{SOURCE6} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools
# Upstream patches
%patch25861 -p1
%patch25862 -p1
%patch25863 -p1
%patch25864 -p1
%patch25866 -p1
%patch25867 -p1
%patch25874 -p1
%patch25909 -p1
%patch25920 -p1
%patch25921 -p1
%patch25922 -p1
%patch25952 -p1
%patch25957 -p1
%patch25958 -p1
%patch25959 -p1
%patch25975 -p1
%patch26077 -p1
%patch26078 -p1
%patch26079 -p1
%patch26081 -p1
%patch26082 -p1
%patch26083 -p1
%patch26084 -p1
%patch26085 -p1
%patch26086 -p1
%patch26087 -p1
%patch26114 -p1
%patch26129 -p1
%patch26133 -p1
%patch26189 -p1
%patch26262 -p1
%patch26324 -p1
%patch26325 -p1
%patch26326 -p1
%patch26327 -p1
%patch26328 -p1
%patch26329 -p1
%patch26330 -p1
%patch26331 -p1
%patch26341 -p1
%patch26342 -p1
%patch26343 -p1
%patch26344 -p1
%patch26369 -p1
%patch26370 -p1
%patch26372 -p1
%patch26404 -p1
%patch26418 -p1
%patch26532 -p1
%patch26547 -p1
%patch26548 -p1
%patch26549 -p1
%patch26550 -p1
%patch26551 -p1
%patch26554 -p1
%patch26555 -p1
%patch26556 -p1
%patch26576 -p1
%patch26577 -p1
%patch26675 -p1
%patch26891 -p1
%patch26902 -p1
%patch26930 -p1
%patch4501 -p1
%patch4502 -p1
%patch4503 -p1
%patch4504 -p1
%patch4505 -p1
%patch4506 -p1
%patch4507 -p1
%patch4508 -p1
%patch48 -p1
%patch49 -p1
%patch88 -p1
%patch89 -p1
%patch90 -p1
%patch91 -p1
%patch92 -p1
%patch93 -p1
%patch94 -p1
%patch95 -p1
# Qemu
%patch100 -p1
# Our patches
%patch301 -p1
%patch302 -p1
%patch304 -p1
%patch305 -p1
%patch306 -p1
%patch307 -p1
%patch310 -p1
%patch311 -p1
%patch312 -p1
%patch313 -p1
%patch314 -p1
%patch315 -p1
%patch322 -p1
%patch323 -p1
%patch324 -p1
%patch325 -p1
%patch327 -p1
%patch328 -p1
%patch329 -p1
%patch340 -p1
%patch341 -p1
%patch342 -p1
%patch343 -p1
%patch344 -p1
%patch345 -p1
%patch350 -p1
%patch351 -p1
%patch352 -p1
%patch353 -p1
%patch354 -p1
%patch355 -p1
%patch356 -p1
%patch357 -p1
%patch358 -p1
%patch370 -p1
%patch371 -p1
%patch372 -p1
%patch373 -p1
%patch374 -p1
%patch375 -p1
%patch376 -p1
%patch377 -p1
%patch378 -p1
%patch379 -p1
%patch380 -p1
%patch381 -p1
%patch382 -p1
%patch410 -p1
%patch411 -p1
%patch412 -p1
%patch413 -p1
%patch414 -p1
%patch415 -p1
%patch420 -p1
%patch421 -p1
%patch423 -p1
%patch424 -p1
%patch425 -p1
%patch426 -p1
%patch427 -p1
%patch428 -p1
%patch429 -p1
%patch430 -p1
%patch431 -p1
%patch433 -p1
%patch434 -p1
%patch435 -p1
%patch436 -p1
%patch438 -p1
%patch439 -p1
%patch440 -p1
%patch442 -p1
%patch446 -p1
%patch447 -p1
%patch448 -p1
%patch449 -p1
%patch450 -p1
%patch451 -p1
%patch452 -p1
%patch453 -p1
%patch454 -p1
%patch456 -p1
%patch457 -p1
%patch458 -p1
%patch459 -p1
%patch460 -p1
%patch461 -p1
%patch462 -p1
%patch463 -p1
%patch464 -p1
%patch465 -p1
%patch466 -p1
%patch480 -p1
%patch481 -p1
%patch500 -p1
%patch501 -p1
%patch502 -p1
%patch503 -p1
%patch504 -p1
%patch505 -p1
%patch506 -p1
%patch507 -p1
%patch511 -p1
%patch512 -p1
%patch513 -p1
%patch650 -p1
%patch651 -p1
%patch652 -p1
%patch700 -p1
%patch800 -p1
%patch801 -p1
%patch802 -p1
%patch99998 -p1
%patch99999 -p1
# tools/qemu-xen-traditional-dir-remote/configure ./tools/qemu-xen-dir-remote/configure use
# clock_gettime to check whether -lrt is needed - and don't check other functions
# with glibc 2.17 clock_gettime is part of libc, so use timer_settime
sed -i -e 's/int main(void) { clockid_t id; return clock_gettime(id, NULL); }/int main(void) { struct itimerspec v;timer_t t; return timer_gettime (t, \&v);}/' \
tools/qemu-xen-traditional-dir-remote/configure ./tools/qemu-xen-dir-remote/configure
%build
XEN_EXTRAVERSION=%version-%release
XEN_EXTRAVERSION=${XEN_EXTRAVERSION#%{xvers}}
sed -i "s/XEN_EXTRAVERSION[\t ]*.=.*\$/XEN_EXTRAVERSION = $XEN_EXTRAVERSION/" xen/Makefile
sed -i "s/XEN_CHANGESET[\t ]*=.*\$/XEN_CHANGESET = %{changeset}/" xen/Makefile
export EXTRA_CFLAGS_XEN_TOOLS="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS"
./configure \
--enable-xenapi \
--prefix=/usr \
--exec_prefix=/usr \
--bindir=%{_bindir} \
--sbindir=%{_sbindir} \
--libdir=%{_libdir} \
--datadir=%{_datadir}
%if %{?with_dom0_support}0
CFLAGS_SAVE=$CFLAGS
make -C xenalyze.hg CC="gcc -I../xen/include -DMAX_CPUS=%{max_cpus} ${RPM_OPT_FLAGS}" %{?_smp_mflags} -k
make -C tools/include/xen-foreign %{?_smp_mflags}
make tools docs %{?_smp_mflags}
make -C tools/debugger/gdbsx
make -C tools/xen-utils-0.1 XEN_INTREE_BUILD=yes XEN_ROOT=$PWD
%else
make -C tools/include/xen-foreign %{?_smp_mflags}
make tools docs %{?_smp_mflags}
%endif
%if %{?with_kmp}0
# pv driver modules
export XL=/usr/src/linux
export XEN=/usr/src/linux/include/xen
mkdir -p obj
for flavor in %flavors_to_build; do
rm -rf obj/$flavor
cp -r unmodified_drivers/linux-2.6 obj/$flavor
cd obj/$flavor
./mkbuildtree
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
%{?_smp_mflags} \
M=$PWD
cd ../..
done
%endif
%install
export EXTRA_CFLAGS_XEN_TOOLS="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS"
%if %{?with_dom0_support}0
# EFI
%ifarch x86_64
make -C xen install \
%if %{?with_gcc46}0
CC=gcc-4.6 \
%endif
max_phys_cpus=%{max_cpus} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags}
make -C xen clean
%endif
install_xen()
{
local ext=""
if [ -n "$1" ]; then
ext="-$1"
mv $RPM_BUILD_ROOT/boot/xen-%{version}-%{release}.gz \
$RPM_BUILD_ROOT/boot/xen${ext}-%{version}-%{release}.gz
mv $RPM_BUILD_ROOT/boot/xen-syms-%{version}-%{release} \
$RPM_BUILD_ROOT/boot/xen-syms${ext}-%{version}-%{release}
fi
rm $RPM_BUILD_ROOT/boot/xen-%{xvers}.gz
rm $RPM_BUILD_ROOT/boot/xen-%{xvermaj}.gz
rm $RPM_BUILD_ROOT/boot/xen.gz
# Do not link to links; grub cannot follow.
ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}-%{xvers}.gz
ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}-%{xvermaj}.gz
ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}.gz
ln -sf xen-syms${ext}-%{version}-%{release} $RPM_BUILD_ROOT/boot/xen-syms${ext}
}
make -C xen install max_phys_cpus=%{max_cpus} pae=%{pae_enabled} debug=y crash_debug=y DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags}
install_xen dbg
make -C xen clean
make -C xen install max_phys_cpus=%{max_cpus} pae=%{pae_enabled} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags}
install_xen
make -C xen clean
make -C tools/include/xen-foreign %{?_smp_mflags}
# tools
export XEN_PYTHON_NATIVE_INSTALL=1
make -C tools install \
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{?_smp_mflags}
rm -f $RPM_BUILD_ROOT/usr/sbin/{qcow-create,img2qcow,qcow2raw}
make -C tools/misc/serial-split install \
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{?_smp_mflags}
%ifarch x86_64
mkdir -p $RPM_BUILD_ROOT/${_libdir}/xen/bin/
ln -s /usr/lib/xen/bin/qemu-dm $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm
%endif
# efi depends on gcc46
echo > xen.files.txt
if test -d $RPM_BUILD_ROOT%{_libdir}/efi
then
echo %{_libdir}/efi >> xen.files.txt
fi
cp -avL xenalyze.hg/dump-raw $RPM_BUILD_ROOT/%{_bindir}/xenalyze.dump-raw
cp -avL xenalyze.hg/xenalyze $RPM_BUILD_ROOT/%{_bindir}
%else
make -C tools install DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{?_smp_mflags}
make -C tools/misc/serial-split install \
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{?_smp_mflags}
%endif
# PV driver modules
%if %{?with_kmp}0
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
for flavor in %flavors_to_build; do
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
M=$PWD/obj/$flavor
install -m644 %SOURCE27 $RPM_BUILD_ROOT/etc/modprobe.d/xen_pvdrivers-$flavor.conf
done
%endif
%if %{?with_dom0_support}0
# Stubdom
%if %{?with_stubdom}0
#remove -fstack-protector flag for stubdom build section
export EXTRA_CFLAGS_XEN_TOOLS=$(echo $RPM_OPT_FLAGS |sed -e 's/-fstack-protector//g')
export EXTRA_CFLAGS_QEMU_TRADITIONAL=$(echo $RPM_OPT_FLAGS |sed -e 's/-fstack-protector//g')
export EXTRA_CFLAGS_QEMU_XEN=$(echo $RPM_OPT_FLAGS |sed -e 's/-fstack-protector//g')
make stubdom %{?_smp_mflags}
make -C stubdom install \
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} \
DOCDIR=%{_defaultdocdir}/xen INCDIR=%{_includedir}
mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen
%ifarch x86_64
ln -s /usr/lib/xen/bin/stubdom-dm $RPM_BUILD_ROOT/usr/lib64/xen/bin/stubdom-dm
ln -s /usr/lib/xen/bin/stubdompath.sh $RPM_BUILD_ROOT/usr/lib64/xen/bin/stubdompath.sh
%endif
#restore -fstack-protector flag
export EXTRA_CFLAGS_XEN_TOOLS="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS"
%endif
# Qemu
#make -C tools/qemu-xen-dir-remote install
# Docs
make -C docs install \
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} \
DOCDIR=%{_defaultdocdir}/xen
for name in COPYING %SOURCE10 %SOURCE11 %SOURCE12; do
install -m 644 $name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/
done
mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc
for name in vtpm.txt crashdb.txt sedf_scheduler_mini-HOWTO.txt xenpaging.txt; do
install -m 644 docs/misc/$name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc/
done
%endif
# init scripts
%if %{?with_dom0_support}0
mkdir -p $RPM_BUILD_ROOT/etc/init.d
install %SOURCE13 $RPM_BUILD_ROOT/etc/init.d/xend
ln -s /etc/init.d/xend $RPM_BUILD_ROOT/usr/sbin/rcxend
install %SOURCE14 $RPM_BUILD_ROOT/etc/init.d/xendomains
ln -s /etc/init.d/xendomains $RPM_BUILD_ROOT/usr/sbin/rcxendomains
install %SOURCE34 $RPM_BUILD_ROOT/etc/init.d/pciback
ln -s /etc/init.d/pciback $RPM_BUILD_ROOT/usr/sbin/rcpciback
install %SOURCE35 $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.pciback
mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
install -m644 %SOURCE26 $RPM_BUILD_ROOT/etc/modprobe.d/xen_loop.conf
# example config
mkdir -p $RPM_BUILD_ROOT/etc/xen/{vm,examples,scripts}
mv $RPM_BUILD_ROOT/etc/xen/xmexample* $RPM_BUILD_ROOT/etc/xen/examples
mv $RPM_BUILD_ROOT/etc/xen/xlexample* $RPM_BUILD_ROOT/etc/xen/examples
rm -f $RPM_BUILD_ROOT/etc/xen/examples/*nbd
install -m644 %SOURCE17 %SOURCE18 $RPM_BUILD_ROOT/etc/xen/examples/
install -m644 tools/xentrace/formats $RPM_BUILD_ROOT/etc/xen/examples/xentrace_formats.txt
# scripts
rm -f $RPM_BUILD_ROOT/etc/xen/scripts/block-*nbd
install -m755 %SOURCE19 %SOURCE20 %SOURCE21 %SOURCE22 %SOURCE23 %SOURCE24 %SOURCE25 %SOURCE29 $RPM_BUILD_ROOT/etc/xen/scripts/
ln -s /etc/xen/scripts/vm-monitor $RPM_BUILD_ROOT/etc/xen/scripts/set-lock
# Xen API remote authentication files
install -d $RPM_BUILD_ROOT/etc/pam.d
install -m644 %SOURCE30 $RPM_BUILD_ROOT/etc/pam.d/xen-api
install -m644 %SOURCE31 $RPM_BUILD_ROOT/etc/xen/
# sysconfig hook for Xen
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/scripts
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/if-down.d
install -m755 %SOURCE32 $RPM_BUILD_ROOT/etc/sysconfig/network/scripts
ln -s /etc/sysconfig/network/scripts/xen-updown.sh $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d/xen
ln -s /etc/sysconfig/network/scripts/xen-updown.sh $RPM_BUILD_ROOT/etc/sysconfig/network/if-down.d/xen
# logrotate
install -m644 -D %SOURCE15 $RPM_BUILD_ROOT/etc/logrotate.d/xen
# directories
mkdir -p $RPM_BUILD_ROOT/var/lib/xenstored
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/images
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/jobs
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/save
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/dump
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/domain
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/migrate
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/vnet
mkdir -p $RPM_BUILD_ROOT/var/log/xen
mkdir -p $RPM_BUILD_ROOT/var/log/xen/console
ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images
# Bootloader
install -m755 %SOURCE16 $RPM_BUILD_ROOT/usr/lib/xen/boot/
install -m755 %SOURCE36 $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages
# udev support
mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d
mv $RPM_BUILD_ROOT/etc/udev/rules.d/xen-backend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xen.rules
mv $RPM_BUILD_ROOT/etc/udev/rules.d/xend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xend.rules
# xen utils
make -C tools/xen-utils-0.1 install DESTDIR=$RPM_BUILD_ROOT XEN_INTREE_BUILD=yes XEN_ROOT=$PWD
# Clean up unpackaged files
rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/xen/qemu/
rm -f $RPM_BUILD_ROOT/%{_datadir}/doc/qemu/qemu-*
rm -f $RPM_BUILD_ROOT/%{_datadir}/doc/packages/xen/html/hypercall/.deps
rm -rf $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/ps
rm -rf $RPM_BUILD_ROOT/usr/share/xen/man/man1/qemu/qemu*
rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-ppc
rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-sparc32
rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-sparc64
rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/openbios-ppc
rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/openbios-sparc32
rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/openbios-sparc64
rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/palcode-clipper
rm -f $RPM_BUILD_ROOT/usr/sbin/netfix
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages/*.egg-info
rm -rf $RPM_BUILD_ROOT/html
rm -rf $RPM_BUILD_ROOT/usr/share/doc/xen/README.*
rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug
rm -f $RPM_BUILD_ROOT/%{_bindir}/qemu-img-xen
rm -f $RPM_BUILD_ROOT/%{_bindir}/qemu-nbd-xen
rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
rm -rf $RPM_BUILD_ROOT/usr/lib/debug
# Upstream Qemu
rm -rf $RPM_BUILD_ROOT/usr/local/share/qemu
rm -rf $RPM_BUILD_ROOT/usr/local/share/doc/qemu
rm -f $RPM_BUILD_ROOT/usr/local/etc/qemu/target-x86_64.conf
rm -f $RPM_BUILD_ROOT/usr/local/share/man/man1/qemu.1
rm -f $RPM_BUILD_ROOT/usr/local/share/man/man1/qemu-img.1
rm -f $RPM_BUILD_ROOT/usr/local/share/man/man8/qemu-nbd.8
rm -f $RPM_BUILD_ROOT/usr/local/share/doc/qemu/qemu-doc.html
rm -f $RPM_BUILD_ROOT/usr/local/share/doc/qemu/qemu-tech.html
#install firewall definitions format is described here:
#/usr/share/SuSEfirewall2/services/TEMPLATE
mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir}
install -m 644 %{S:26} $RPM_BUILD_ROOT/%{_fwdefdir}/xend-relocation-server
# create symlinks for keymaps
%fdupes -s $RPM_BUILD_ROOT/%{_datadir}
%else
# 32 bit hypervisor no longer supported. Remove dom0 tools.
rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc
rm -rf $RPM_BUILD_ROOT/usr/local/share/doc
rm -rf $RPM_BUILD_ROOT/%{_datadir}/man
rm -rf $RPM_BUILD_ROOT/usr/local/share/man
rm -rf $RPM_BUILD_ROOT/%{_datadir}/qemu-xen
rm -rf $RPM_BUILD_ROOT/%{_datadir}/xen
rm -rf $RPM_BUILD_ROOT/%{_datadir}/locale
rm -rf $RPM_BUILD_ROOT/%{_libdir}/xen
rm -rf $RPM_BUILD_ROOT/%{_libdir}/python*
rm -rf $RPM_BUILD_ROOT/usr/sbin
rm -rf $RPM_BUILD_ROOT/etc/bash_completion.d
rm -rf $RPM_BUILD_ROOT/etc/init.d
rm -rf $RPM_BUILD_ROOT/etc/logrotate.d
rm -rf $RPM_BUILD_ROOT/etc/pam.d
rm -rf $RPM_BUILD_ROOT/etc/sysconfig
rm -rf $RPM_BUILD_ROOT/etc/udev
rm -rf $RPM_BUILD_ROOT/etc/qemu
rm -rf $RPM_BUILD_ROOT/etc/xen
rm -rf $RPM_BUILD_ROOT/usr/local/etc
rm -rf $RPM_BUILD_ROOT/var
rm -f $RPM_BUILD_ROOT/%{_bindir}/*store*
rm -f $RPM_BUILD_ROOT/%{_bindir}/*trace*
rm -f $RPM_BUILD_ROOT/%{_bindir}/xenalyze*
rm -f $RPM_BUILD_ROOT/%{_bindir}/qemu*
rm -f $RPM_BUILD_ROOT/%{_bindir}/pygrub
rm -f $RPM_BUILD_ROOT/%{_bindir}/remus
rm -f $RPM_BUILD_ROOT/%{_bindir}/tapdisk-ioemu
rm -f $RPM_BUILD_ROOT/%{_bindir}/xencons
%endif
%if %{?with_dom0_support}0
%files -f xen.files.txt
%defattr(-,root,root)
/boot/xen-%{version}-%{release}.gz
/boot/xen-%{xvermaj}.gz
/boot/xen-%{xvers}.gz
/boot/xen-dbg-%{version}-%{release}.gz
/boot/xen-dbg-%{xvermaj}.gz
/boot/xen-dbg-%{xvers}.gz
/boot/xen-dbg.gz
/boot/xen-syms
/boot/xen-syms-%{version}-%{release}
/boot/xen-syms-dbg
/boot/xen-syms-dbg-%{version}-%{release}
/boot/xen.gz
%endif
%files libs
%defattr(-,root,root)
%{_libdir}/fs/
%{_libdir}/*.so.*
%if %{?with_dom0_support}0
%files tools
%defattr(-,root,root)
/usr/bin/xenalyze
/usr/bin/xenalyze.dump-raw
/usr/bin/xencons
/usr/bin/xenstore*
/usr/bin/xentrace*
/usr/bin/pygrub
/usr/bin/tapdisk-ioemu
/usr/bin/remus
/usr/sbin/blktapctrl
/usr/sbin/flask-loadpolicy
/usr/sbin/flask-getenforce
/usr/sbin/flask-setenforce
/usr/sbin/flask-get-bool
/usr/sbin/flask-label-pci
/usr/sbin/flask-set-bool
/usr/sbin/rcxend
/usr/sbin/rcxendomains
/usr/sbin/rcpciback
/usr/sbin/tapdisk
/usr/sbin/xen*
/usr/sbin/xm
/usr/sbin/xsview
/usr/sbin/gtracestat
/usr/sbin/gtraceview
/usr/sbin/lock-util
/usr/sbin/tapdisk-client
/usr/sbin/tapdisk-diff
/usr/sbin/tapdisk-stream
/usr/sbin/tapdisk2
/usr/sbin/td-util
/usr/sbin/vhd-update
/usr/sbin/vhd-util
/usr/sbin/gdbsx
/usr/sbin/xl
/usr/sbin/kdd
/usr/sbin/tap-ctl
%{_libdir}/xen
%ifarch x86_64
/usr/lib/xen
%endif
%{_mandir}/man1/*.1.gz
%{_mandir}/man5/*.5.gz
%{_mandir}/man8/*.8.gz
/var/adm/fillup-templates/*
%dir /var/lib/xen
%dir %attr(700,root,root) /var/lib/xen/images
%dir %attr(700,root,root) /var/lib/xen/save
%dir %attr(700,root,root) /var/lib/xen/dump
%dir %attr(700,root,root) /var/lib/xen/xenpaging
%dir /var/lib/xen/xend-db
%dir /var/lib/xen/xend-db/domain
%dir /var/lib/xen/xend-db/migrate
%dir /var/lib/xen/xend-db/vnet
%dir /var/lib/xenstored
%dir /var/log/xen
%dir /var/log/xen/console
%config /etc/init.d/*
%config /etc/logrotate.d/xen
%dir %attr(700,root,root) /etc/xen
/etc/xen/auto
%config /etc/xen/examples
/etc/xen/images
/etc/xen/scripts
%config /etc/xen/cpupool
/etc/xen/README*
%config /etc/xen/vm
%config(noreplace) /etc/xen/*.sxp
%config(noreplace) /etc/xen/*.xml
%config(noreplace) /etc/xen/xenapiusers
%config(noreplace) /etc/xen/xl.conf
%config /etc/pam.d/xen-api
%config /etc/modprobe.d/xen_loop.conf
%dir /etc/modprobe.d
%dir /etc/udev
%dir /etc/udev/rules.d
/etc/udev/rules.d/40-xen.rules
/etc/udev/rules.d/40-xend.rules
/etc/sysconfig/network/scripts/xen-updown.sh
/etc/sysconfig/network/if-up.d/xen
/etc/sysconfig/network/if-down.d/xen
/etc/bash_completion.d/xl.sh
%dir %{_defaultdocdir}/xen
%{_defaultdocdir}/xen/COPYING
%{_defaultdocdir}/xen/README.SuSE
%{_defaultdocdir}/xen/boot.local.xenU
%{_defaultdocdir}/xen/boot.xen
%{_defaultdocdir}/xen/misc
%dir %{_libdir}/python%{pyver}/site-packages/xen
%dir %{_libdir}/python%{pyver}/site-packages/grub
%dir %{_datadir}/qemu-xen
%dir %{_datadir}/xen
%dir %{_datadir}/xen/man
%dir %{_datadir}/xen/man/man1
%dir %{_datadir}/xen/man/man8
%dir %{_datadir}/xen/qemu
%{_datadir}/qemu-xen/*
%{_datadir}/xen/*.dtd
%{_datadir}/xen/qemu/*
%{_datadir}/xen/man/man1/*
%{_datadir}/xen/man/man8/*
%{_libdir}/python%{pyver}/site-packages/xen/*
%{_libdir}/python%{pyver}/site-packages/grub/*
%{_libdir}/python%{pyver}/site-packages/fsimage.so
%{_libdir}/python%{pyver}/site-packages/xnloader.py
%config %{_fwdefdir}/xend-relocation-server
%endif
%files tools-domU
%defattr(-,root,root)
/usr/bin/xen-detect
/bin/domu-xenstore
/bin/xenstore-*
%files devel
%defattr(-,root,root)
%{_bindir}/serial-split
%{_libdir}/*.a
%{_libdir}/*.so
/usr/include/*
%if %{?with_dom0_support}0
%files doc-html
%defattr(-,root,root)
%{_defaultdocdir}/xen/html
#%{_datadir}/doc/qemu
%files doc-pdf
%defattr(-,root,root)
%{_defaultdocdir}/xen/pdf
%endif
%if %{?with_dom0_support}0
%post tools
%if %{?with_xend}0
# with_xend
# enable both xm (xend based) and xl (libxl based)
if /bin/ls /etc/init.d/rc3.d/S??xend > /dev/null 2>&1 ; then
if ! /bin/ls /etc/init.d/rc3.d/S??xencommons > /dev/null 2>&1 ; then
echo "postin %{name}-tools: Forcing insserv xencommons during package upgrade because xend was enabled."
echo "postin %{name}-tools: with xend"
fi
%{fillup_and_insserv -Y -n xencommons xencommons}
else
%{fillup_and_insserv -y -n xencommons xencommons}
fi
%{fillup_and_insserv -y -n xend xend}
%else
# without_xend
# disable xm (xend based) and enable only xl (libxl based)
if /bin/ls /etc/init.d/rc3.d/S??xend > /dev/null 2>&1 ; then
if ! /bin/ls /etc/init.d/rc3.d/S??xencommons > /dev/null 2>&1 ; then
echo "postin %{name}-tools: Forcing insserv xencommons during package upgrade because xend was enabled."
fi
echo "postin %{name}-tools: disabling xend in favor of xencommons. xm command replaced by xl."
%{stop_on_removal xend}
rm -fv /etc/init.d/rc?.d/???xend || :
%{fillup_and_insserv -Y -n xencommons xencommons}
else
%{fillup_and_insserv -y -n xencommons xencommons}
fi
%endif
#
%{fillup_and_insserv -y -n xendomains xendomains}
%{fillup_only -n pciback}
if [ -f /usr/bin/qemu-img ]; then
if [ -f /usr/bin/qemu-img-xen ]; then
rm /usr/bin/qemu-img-xen
fi
ln -s /usr/bin/qemu-img /usr/bin/qemu-img-xen
fi
if [ -f /usr/bin/qemu-nbd ]; then
if [ -f /usr/bin/qemu-nbd-xen ]; then
rm /usr/bin/qemu-nbd-xen
fi
ln -s /usr/bin/qemu-nbd /usr/bin/qemu-nbd-xen
fi
%preun tools
%{stop_on_removal xendomains xend xencommons}
%postun tools
%if %{?with_xend}0
# with_xend
%{restart_on_update xend}
%endif
%{insserv_cleanup}
if [ -f /usr/bin/qemu-img-xen ]; then
rm /usr/bin/qemu-img-xen
fi
if [ -f /usr/bin/qemu-nbd-xen ]; then
rm /usr/bin/qemu-nbd-xen
fi
%endif
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%changelog