Accepting request 67740 from Virtualization
Accepted submit request 67740 from user coolo OBS-URL: https://build.opensuse.org/request/show/67740 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xen?expand=0&rev=129
This commit is contained in:
commit
454e371509
@ -24,6 +24,7 @@ rc_reset
|
|||||||
LOCKFILE=/var/lock/subsys/xendomains
|
LOCKFILE=/var/lock/subsys/xendomains
|
||||||
XENDOM_CONFIG=/etc/sysconfig/xendomains
|
XENDOM_CONFIG=/etc/sysconfig/xendomains
|
||||||
RETCODE_FILE=/tmp/xendomains.rc.$$
|
RETCODE_FILE=/tmp/xendomains.rc.$$
|
||||||
|
xm_cmd=xl
|
||||||
|
|
||||||
. "$XENDOM_CONFIG"
|
. "$XENDOM_CONFIG"
|
||||||
|
|
||||||
@ -127,7 +128,7 @@ parseln()
|
|||||||
|
|
||||||
xm_list()
|
xm_list()
|
||||||
{
|
{
|
||||||
TERM=vt100 xm list | grep -v '^Name *ID'
|
TERM=vt100 ${xm_cmd} list | grep -v '^Name *ID'
|
||||||
}
|
}
|
||||||
|
|
||||||
is_cfg_running()
|
is_cfg_running()
|
||||||
@ -163,7 +164,7 @@ start()
|
|||||||
printed=1
|
printed=1
|
||||||
for dom in "$XENDOMAINS_SAVE"/*; do
|
for dom in "$XENDOMAINS_SAVE"/*; do
|
||||||
echo -n " ${dom##*/}: "
|
echo -n " ${dom##*/}: "
|
||||||
xm restore "$dom" >/dev/null 2>&1
|
${xm_cmd} restore "$dom" >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
rc_failed
|
rc_failed
|
||||||
else
|
else
|
||||||
@ -184,9 +185,9 @@ start()
|
|||||||
rc_status -s
|
rc_status -s
|
||||||
else
|
else
|
||||||
if grep -q "^name" "$dom";then
|
if grep -q "^name" "$dom";then
|
||||||
xm create --quiet --defconfig "$dom"
|
${xm_cmd} create --quiet --defconfig "$dom"
|
||||||
elif grep -q "(name .*" "$dom";then
|
elif grep -q "(name .*" "$dom";then
|
||||||
xm create --quiet --config "$dom"
|
${xm_cmd} create --quiet --config "$dom"
|
||||||
fi
|
fi
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
rc_failed
|
rc_failed
|
||||||
@ -224,19 +225,19 @@ any_non_zombies()
|
|||||||
|
|
||||||
migrate_with_watchdog()
|
migrate_with_watchdog()
|
||||||
{
|
{
|
||||||
(xm migrate "$@" ; echo $? > "$RETCODE_FILE") >/dev/null 2>&1 &
|
(${xm_cmd} migrate "$@" ; echo $? > "$RETCODE_FILE") >/dev/null 2>&1 &
|
||||||
watchdog_xm $!
|
watchdog_xm $!
|
||||||
}
|
}
|
||||||
|
|
||||||
save_with_watchdog()
|
save_with_watchdog()
|
||||||
{
|
{
|
||||||
(xm save "$@" ; echo $? > "$RETCODE_FILE") >/dev/null 2>&1 &
|
(${xm_cmd} save "$@" ; echo $? > "$RETCODE_FILE") >/dev/null 2>&1 &
|
||||||
watchdog_xm $!
|
watchdog_xm $!
|
||||||
}
|
}
|
||||||
|
|
||||||
shutdown_with_watchdog()
|
shutdown_with_watchdog()
|
||||||
{
|
{
|
||||||
(xm shutdown -w "$@" ; echo $? > "$RETCODE_FILE") >/dev/null 2>&1 &
|
(${xm_cmd} shutdown -w "$@" ; echo $? > "$RETCODE_FILE") >/dev/null 2>&1 &
|
||||||
watchdog_xm $!
|
watchdog_xm $!
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,7 +310,7 @@ stop()
|
|||||||
for sysrq in $XENDOMAINS_SYSRQ; do
|
for sysrq in $XENDOMAINS_SYSRQ; do
|
||||||
echo -n " $name: "
|
echo -n " $name: "
|
||||||
echo -n "sending sysrq '$sysrq'... "
|
echo -n "sending sysrq '$sysrq'... "
|
||||||
xm sysrq $id $sysrq
|
${xm_cmd} sysrq $id $sysrq
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
rc_failed
|
rc_failed
|
||||||
else
|
else
|
||||||
@ -323,7 +324,7 @@ stop()
|
|||||||
if is_zombie_state "$state"; then
|
if is_zombie_state "$state"; then
|
||||||
echo -n " $name: "
|
echo -n " $name: "
|
||||||
echo -n "destroying zombie... "
|
echo -n "destroying zombie... "
|
||||||
xm destroy $id
|
${xm_cmd} destroy $id
|
||||||
rc_reset
|
rc_reset
|
||||||
rc_status -v
|
rc_status -v
|
||||||
continue
|
continue
|
||||||
|
@ -12,6 +12,7 @@ usage () {
|
|||||||
exit $R_USAGE
|
exit $R_USAGE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xm_cmd=xl
|
||||||
######################################################################
|
######################################################################
|
||||||
# change the working direcory and source some common files
|
# change the working direcory and source some common files
|
||||||
#
|
#
|
||||||
@ -94,7 +95,7 @@ parseln()
|
|||||||
|
|
||||||
xm_list()
|
xm_list()
|
||||||
{
|
{
|
||||||
TERM=vt100 xm list | grep -v '^Name *ID'
|
TERM=vt100 ${xm_cmd} list | grep -v '^Name *ID'
|
||||||
}
|
}
|
||||||
|
|
||||||
# For the specified vm, return a list of vifs that are connected to $INTERFACE
|
# For the specified vm, return a list of vifs that are connected to $INTERFACE
|
||||||
|
34
xen.changes
34
xen.changes
@ -1,3 +1,37 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Apr 11 15:55:04 MDT 2011 - jfehlig@suse.de
|
||||||
|
|
||||||
|
- bnc#685338: Fix porting of xend-domain-lock.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Apr 11 19:33:34 CEST 2011 - ohering@suse.de
|
||||||
|
|
||||||
|
- update scripts to use xl instead of xm:
|
||||||
|
xen-updown.sh, init.xendomains, xmclone.sh
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Apr 11 17:34:46 CEST 2011 - ohering@suse.de
|
||||||
|
|
||||||
|
- disable xend in openSuSE > 11.4
|
||||||
|
the xl command is the replacement for the xm command
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Apr 7 18:16:45 CEST 2011 - ohering@suse.de
|
||||||
|
|
||||||
|
- mark runlevel scripts as config to preserve local changes by
|
||||||
|
admin or dev during package update
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Apr 7 18:11:14 CEST 2011 - ohering@suse.de
|
||||||
|
|
||||||
|
- enable xencommons runlevel script during upgrade if xend was
|
||||||
|
already enabled
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Apr 7 17:50:23 CEST 2011 - ohering@suse.de
|
||||||
|
|
||||||
|
- call /sbin/ldconfig directly in xen-libs post install scripts
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Mar 31 12:41:24 UTC 2011 - coolo@novell.com
|
Thu Mar 31 12:41:24 UTC 2011 - coolo@novell.com
|
||||||
|
|
||||||
|
219
xen.spec
219
xen.spec
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# spec file for package xen
|
# spec file for package xen (Version 4.1.0_01)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
@ -26,39 +26,44 @@ ExclusiveArch: %ix86 x86_64
|
|||||||
%define xen_build_dir xen-4.1.0-testing
|
%define xen_build_dir xen-4.1.0-testing
|
||||||
%define with_kmp 1
|
%define with_kmp 1
|
||||||
%define with_stubdom 0
|
%define with_stubdom 0
|
||||||
BuildRequires: LibVNCServer-devel
|
%if %suse_version > 1140
|
||||||
BuildRequires: SDL-devel
|
%define with_xend 0
|
||||||
BuildRequires: automake
|
%else
|
||||||
BuildRequires: bin86
|
%define with_xend 1
|
||||||
BuildRequires: curl-devel
|
%endif
|
||||||
BuildRequires: dev86
|
BuildRequires: LibVNCServer-devel
|
||||||
BuildRequires: graphviz
|
BuildRequires: SDL-devel
|
||||||
BuildRequires: latex2html
|
BuildRequires: automake
|
||||||
BuildRequires: libjpeg-devel
|
BuildRequires: bin86
|
||||||
BuildRequires: libxml2-devel
|
BuildRequires: curl-devel
|
||||||
BuildRequires: ncurses-devel
|
BuildRequires: dev86
|
||||||
BuildRequires: openssl
|
BuildRequires: graphviz
|
||||||
BuildRequires: openssl-devel
|
BuildRequires: latex2html
|
||||||
BuildRequires: pciutils-devel
|
BuildRequires: libjpeg-devel
|
||||||
BuildRequires: python-devel
|
BuildRequires: libxml2-devel
|
||||||
BuildRequires: texinfo
|
BuildRequires: ncurses-devel
|
||||||
BuildRequires: transfig
|
BuildRequires: openssl
|
||||||
BuildRequires: libbz2-devel
|
BuildRequires: openssl-devel
|
||||||
|
BuildRequires: pciutils-devel
|
||||||
|
BuildRequires: python-devel
|
||||||
|
BuildRequires: texinfo
|
||||||
|
BuildRequires: transfig
|
||||||
|
BuildRequires: libbz2-devel
|
||||||
%if %suse_version >= 1120
|
%if %suse_version >= 1120
|
||||||
BuildRequires: xz-devel
|
BuildRequires: xz-devel
|
||||||
%endif
|
%endif
|
||||||
%if %suse_version <= 1110
|
%if %suse_version <= 1110
|
||||||
BuildRequires: pmtools
|
BuildRequires: pmtools
|
||||||
%else
|
%else
|
||||||
BuildRequires: acpica
|
BuildRequires: acpica
|
||||||
%endif
|
%endif
|
||||||
%if %suse_version >= 1030
|
%if %suse_version >= 1030
|
||||||
BuildRequires: texlive
|
BuildRequires: texlive
|
||||||
BuildRequires: texlive-latex
|
BuildRequires: texlive-latex
|
||||||
%else
|
%else
|
||||||
BuildRequires: te_ams
|
BuildRequires: te_ams
|
||||||
BuildRequires: te_latex
|
BuildRequires: te_latex
|
||||||
BuildRequires: tetex
|
BuildRequires: tetex
|
||||||
%endif
|
%endif
|
||||||
%ifarch x86_64
|
%ifarch x86_64
|
||||||
BuildRequires: glibc-32bit glibc-devel-32bit
|
BuildRequires: glibc-32bit glibc-devel-32bit
|
||||||
@ -75,7 +80,7 @@ BuildRequires: glibc-devel
|
|||||||
BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11
|
BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11
|
||||||
%endif
|
%endif
|
||||||
Version: 4.1.0_01
|
Version: 4.1.0_01
|
||||||
Release: 5
|
Release: 1
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: System/Kernel
|
Group: System/Kernel
|
||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
@ -167,7 +172,7 @@ Patch370: xend-sysconfig.patch
|
|||||||
Patch371: domu-usb-controller.patch
|
Patch371: domu-usb-controller.patch
|
||||||
Patch372: usb-list.patch
|
Patch372: usb-list.patch
|
||||||
Patch373: xend-devid-or-name.patch
|
Patch373: xend-devid-or-name.patch
|
||||||
Patch374: suspend_evtchn_lock.patch
|
Patch374: suspend_evtchn_lock.patch
|
||||||
# Patches for snapshot support
|
# Patches for snapshot support
|
||||||
Patch400: snapshot-ioemu-save.patch
|
Patch400: snapshot-ioemu-save.patch
|
||||||
Patch401: snapshot-ioemu-restore.patch
|
Patch401: snapshot-ioemu-restore.patch
|
||||||
@ -223,39 +228,38 @@ Patch651: ioemu-disable-scsi.patch
|
|||||||
Patch652: ioemu-disable-emulated-ide-if-pv.patch
|
Patch652: ioemu-disable-emulated-ide-if-pv.patch
|
||||||
Patch700: hv_extid_compatibility.patch
|
Patch700: hv_extid_compatibility.patch
|
||||||
# FATE 310510
|
# FATE 310510
|
||||||
Patch10001: xenpaging.tools_xenpaging_cleanup.patch
|
Patch10001: xenpaging.tools_xenpaging_cleanup.patch
|
||||||
Patch10002: xenpaging.pageout_policy.patch
|
Patch10002: xenpaging.pageout_policy.patch
|
||||||
Patch10003: xenpaging.get_paged_frame.patch
|
Patch10003: xenpaging.get_paged_frame.patch
|
||||||
Patch10004: xenpaging.makefile.patch
|
Patch10004: xenpaging.makefile.patch
|
||||||
Patch10010: xenpaging.policy_linear.patch
|
Patch10010: xenpaging.policy_linear.patch
|
||||||
Patch10011: xenpaging.pagefile.patch
|
Patch10011: xenpaging.pagefile.patch
|
||||||
Patch10012: xenpaging.xenpaging_init.patch
|
Patch10012: xenpaging.xenpaging_init.patch
|
||||||
Patch10013: xenpaging.mem_paging_tool_qemu_flush_cache.patch
|
Patch10013: xenpaging.mem_paging_tool_qemu_flush_cache.patch
|
||||||
Patch10014: xenpaging.machine_to_phys_mapping.patch
|
Patch10014: xenpaging.machine_to_phys_mapping.patch
|
||||||
Patch10015: xenpaging.populate_only_if_paged.patch
|
Patch10015: xenpaging.populate_only_if_paged.patch
|
||||||
Patch10017: xenpaging.autostart.patch
|
Patch10017: xenpaging.autostart.patch
|
||||||
Patch10018: xenpaging.signal_handling.patch
|
Patch10018: xenpaging.signal_handling.patch
|
||||||
Patch10019: xenpaging.MRU_SIZE.patch
|
Patch10019: xenpaging.MRU_SIZE.patch
|
||||||
Patch10020: xenpaging.guest_remove_page.patch
|
Patch10020: xenpaging.guest_remove_page.patch
|
||||||
Patch10021: xenpaging.mem_event_check_ring-free_requests.patch
|
Patch10021: xenpaging.mem_event_check_ring-free_requests.patch
|
||||||
Patch10022: xenpaging.blacklist.patch
|
Patch10022: xenpaging.blacklist.patch
|
||||||
Patch10023: xenpaging.autostart_delay.patch
|
Patch10023: xenpaging.autostart_delay.patch
|
||||||
Patch10024: xenpaging.page_already_populated.patch
|
Patch10024: xenpaging.page_already_populated.patch
|
||||||
Patch10025: xenpaging.notify_policy_only_once.patch
|
Patch10025: xenpaging.notify_policy_only_once.patch
|
||||||
Patch10026: xenpaging.num_pages_equal_max_pages.patch
|
Patch10026: xenpaging.num_pages_equal_max_pages.patch
|
||||||
Patch10027: xenpaging.p2m_mem_paging_populate_if_p2m_ram_paged.patch
|
Patch10027: xenpaging.p2m_mem_paging_populate_if_p2m_ram_paged.patch
|
||||||
Patch10028: xenpaging.HVMCOPY_gfn_paged_out.patch
|
Patch10028: xenpaging.HVMCOPY_gfn_paged_out.patch
|
||||||
Patch10029: xenpaging.optimize_p2m_mem_paging_populate.patch
|
Patch10029: xenpaging.optimize_p2m_mem_paging_populate.patch
|
||||||
Patch10030: xenpaging.paging_prep_enomem.patch
|
Patch10030: xenpaging.paging_prep_enomem.patch
|
||||||
Patch10031: xenpaging.print-arguments.patch
|
Patch10031: xenpaging.print-arguments.patch
|
||||||
Patch10032: xenpaging.no_domain_id.patch
|
Patch10032: xenpaging.no_domain_id.patch
|
||||||
Patch10033: xenpaging.runtime_mru_size.patch
|
Patch10033: xenpaging.runtime_mru_size.patch
|
||||||
Patch10040: xenpaging.doc.patch
|
Patch10040: xenpaging.doc.patch
|
||||||
# Build patch
|
# Build patch
|
||||||
Patch99999: tmp_build.patch
|
Patch99999: tmp_build.patch
|
||||||
Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
|
Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
#%define pysite %(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()")
|
|
||||||
%define pyver %(python -c "import sys; print sys.version[:3]")
|
%define pyver %(python -c "import sys; print sys.version[:3]")
|
||||||
%if %{?with_kmp}0
|
%if %{?with_kmp}0
|
||||||
%suse_kernel_module_package -n xen um xen -f kmp_filelist
|
%suse_kernel_module_package -n xen um xen -f kmp_filelist
|
||||||
@ -714,6 +718,7 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools
|
|||||||
#%patch10040 -p1
|
#%patch10040 -p1
|
||||||
%patch99999 -p1
|
%patch99999 -p1
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
XEN_EXTRAVERSION=%version-%release
|
XEN_EXTRAVERSION=%version-%release
|
||||||
XEN_EXTRAVERSION=${XEN_EXTRAVERSION#%{xvers}}
|
XEN_EXTRAVERSION=${XEN_EXTRAVERSION#%{xvers}}
|
||||||
@ -726,9 +731,6 @@ make -C xenalyze.hg CC="gcc -I../xen/include" %{?_smp_mflags}
|
|||||||
make -C tools/include/xen-foreign %{?_smp_mflags}
|
make -C tools/include/xen-foreign %{?_smp_mflags}
|
||||||
make tools docs %{?_smp_mflags}
|
make tools docs %{?_smp_mflags}
|
||||||
make -C tools/debugger/gdbsx
|
make -C tools/debugger/gdbsx
|
||||||
#### there are code problems that don't pass the 02-check-gcc-output, hence bitbucket
|
|
||||||
###env MAKE="make %{?_smp_mflags}" ./gdbbuild 1>/dev/null 2>/dev/null
|
|
||||||
###cd ../../..
|
|
||||||
%if %{?with_kmp}0
|
%if %{?with_kmp}0
|
||||||
# pv driver modules
|
# pv driver modules
|
||||||
export XL=/usr/src/linux
|
export XL=/usr/src/linux
|
||||||
@ -748,9 +750,7 @@ done
|
|||||||
make -C tools/xen-utils-0.1 XEN_INTREE_BUILD=yes
|
make -C tools/xen-utils-0.1 XEN_INTREE_BUILD=yes
|
||||||
|
|
||||||
%install
|
%install
|
||||||
test ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT
|
|
||||||
export CFLAGS="$RPM_OPT_FLAGS"
|
export CFLAGS="$RPM_OPT_FLAGS"
|
||||||
export RPM_OPT_FLAGS
|
|
||||||
install_xen()
|
install_xen()
|
||||||
{
|
{
|
||||||
local ext=""
|
local ext=""
|
||||||
@ -776,8 +776,6 @@ 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}
|
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
|
install_xen
|
||||||
make -C xen clean
|
make -C xen clean
|
||||||
export CFLAGS="$RPM_OPT_FLAGS"
|
|
||||||
export RPM_OPT_FLAGS
|
|
||||||
make -C tools/include/xen-foreign %{?_smp_mflags}
|
make -C tools/include/xen-foreign %{?_smp_mflags}
|
||||||
# tools
|
# tools
|
||||||
export XEN_PYTHON_NATIVE_INSTALL=1
|
export XEN_PYTHON_NATIVE_INSTALL=1
|
||||||
@ -812,7 +810,6 @@ make -C stubdom install \
|
|||||||
DOCDIR=%{_defaultdocdir}/xen INCDIR=%{_includedir}
|
DOCDIR=%{_defaultdocdir}/xen INCDIR=%{_includedir}
|
||||||
mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen
|
mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen
|
||||||
%ifarch x86_64
|
%ifarch x86_64
|
||||||
ln -s /usr/lib/xen/boot/pv-grub-x86_32.gz $RPM_BUILD_ROOT/usr/lib/xen/boot/pv-grub-x86_32.gz
|
|
||||||
ln -s /usr/lib/xen/bin/stubdom-dm $RPM_BUILD_ROOT/usr/lib64/xen/bin/stubdom-dm
|
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
|
ln -s /usr/lib/xen/bin/stubdompath.sh $RPM_BUILD_ROOT/usr/lib64/xen/bin/stubdompath.sh
|
||||||
%endif
|
%endif
|
||||||
@ -868,7 +865,6 @@ 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/domain
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/migrate
|
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/lib/xen/xend-db/vnet
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xenpaging
|
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/log/xen
|
mkdir -p $RPM_BUILD_ROOT/var/log/xen
|
||||||
ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images
|
ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images
|
||||||
# Bootloader
|
# Bootloader
|
||||||
@ -889,7 +885,6 @@ 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/xen/qemu/openbios-sparc64
|
||||||
rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-ppc
|
rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-ppc
|
||||||
rm -f $RPM_BUILD_ROOT/usr/sbin/netfix
|
rm -f $RPM_BUILD_ROOT/usr/sbin/netfix
|
||||||
#rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
|
|
||||||
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages/*.egg-info
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages/*.egg-info
|
||||||
rm -rf $RPM_BUILD_ROOT/html
|
rm -rf $RPM_BUILD_ROOT/html
|
||||||
rm -rf $RPM_BUILD_ROOT/usr/share/doc/xen/README.*
|
rm -rf $RPM_BUILD_ROOT/usr/share/doc/xen/README.*
|
||||||
@ -919,13 +914,7 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
|
|||||||
%files libs
|
%files libs
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_libdir}/fs/
|
%{_libdir}/fs/
|
||||||
%{_libdir}/libblktap.so.*
|
%{_libdir}/*.so.*
|
||||||
%{_libdir}/libflask.so.*
|
|
||||||
%{_libdir}/libfsimage.so.*
|
|
||||||
%{_libdir}/libxen*.so.*
|
|
||||||
%{_libdir}/libvhd.so.*
|
|
||||||
%{_libdir}/libxlutil.so.*
|
|
||||||
%{_libdir}/libblktapctl.so.*
|
|
||||||
|
|
||||||
%files tools
|
%files tools
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
@ -990,18 +979,14 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
|
|||||||
%dir /var/lib/xen/xend-db/vnet
|
%dir /var/lib/xen/xend-db/vnet
|
||||||
%dir /var/lib/xenstored
|
%dir /var/lib/xenstored
|
||||||
%dir /var/log/xen
|
%dir /var/log/xen
|
||||||
/etc/init.d/xend
|
%config /etc/init.d/*
|
||||||
/etc/init.d/xendomains
|
|
||||||
/etc/init.d/xencommons
|
|
||||||
/etc/init.d/xen-watchdog
|
|
||||||
%config /etc/logrotate.d/xen
|
%config /etc/logrotate.d/xen
|
||||||
%dir %attr(700,root,root) /etc/xen
|
%dir %attr(700,root,root) /etc/xen
|
||||||
/etc/xen/auto
|
/etc/xen/auto
|
||||||
%config /etc/xen/examples
|
%config /etc/xen/examples
|
||||||
/etc/xen/images
|
/etc/xen/images
|
||||||
/etc/xen/scripts
|
/etc/xen/scripts
|
||||||
/etc/xen/cpupool
|
%config /etc/xen/cpupool
|
||||||
#/etc/xen/scripts/qemu-ifup
|
|
||||||
/etc/xen/README*
|
/etc/xen/README*
|
||||||
%config /etc/xen/vm
|
%config /etc/xen/vm
|
||||||
%config(noreplace) /etc/xen/*.sxp
|
%config(noreplace) /etc/xen/*.sxp
|
||||||
@ -1032,7 +1017,6 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
|
|||||||
%dir %{_datadir}/xen/man/man1
|
%dir %{_datadir}/xen/man/man1
|
||||||
%dir %{_datadir}/xen/man/man8
|
%dir %{_datadir}/xen/man/man8
|
||||||
%dir %{_datadir}/xen/qemu
|
%dir %{_datadir}/xen/qemu
|
||||||
#%dir %{_datadir}/xen/qemu/keymaps
|
|
||||||
%{_datadir}/xen/*.dtd
|
%{_datadir}/xen/*.dtd
|
||||||
%{_datadir}/xen/qemu/*
|
%{_datadir}/xen/qemu/*
|
||||||
%{_datadir}/xen/man/man1/*
|
%{_datadir}/xen/man/man1/*
|
||||||
@ -1055,12 +1039,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
|
|||||||
#/usr/lib/xen/bin/xc_kexec
|
#/usr/lib/xen/bin/xc_kexec
|
||||||
%endif
|
%endif
|
||||||
/usr/lib/xen/boot/hvmloader
|
/usr/lib/xen/boot/hvmloader
|
||||||
#%pysite/xen/*
|
|
||||||
%{_libdir}/python%{pyver}/site-packages/xen/*
|
%{_libdir}/python%{pyver}/site-packages/xen/*
|
||||||
/usr/lib/xen/boot/domUloader.py
|
/usr/lib/xen/boot/domUloader.py
|
||||||
#%pysite/grub/*
|
|
||||||
%{_libdir}/python%{pyver}/site-packages/grub/*
|
%{_libdir}/python%{pyver}/site-packages/grub/*
|
||||||
#%pysite/fsimage.so
|
|
||||||
%{_libdir}/python%{pyver}/site-packages/fsimage.so
|
%{_libdir}/python%{pyver}/site-packages/fsimage.so
|
||||||
%if %{?with_stubdom}0
|
%if %{?with_stubdom}0
|
||||||
/usr/lib/xen/boot/ioemu-stubdom.gz
|
/usr/lib/xen/boot/ioemu-stubdom.gz
|
||||||
@ -1078,29 +1059,10 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
|
|||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_libdir}/libblktap.a
|
%{_libdir}/*.a
|
||||||
%{_libdir}/libblktap.so
|
%{_libdir}/*.so
|
||||||
%{_libdir}/libflask.a
|
/usr/include/*
|
||||||
%{_libdir}/libflask.so
|
|
||||||
%{_libdir}/libfsimage.so
|
|
||||||
%{_libdir}/libxen*.a
|
|
||||||
%{_libdir}/libxen*.so
|
|
||||||
%{_libdir}/libvhd.a
|
|
||||||
%{_libdir}/libvhd.so
|
|
||||||
%{_libdir}/libxlutil.a
|
|
||||||
%{_libdir}/libxlutil.so
|
|
||||||
%{_libdir}/libblktapctl.a
|
|
||||||
%{_libdir}/libblktapctl.so
|
|
||||||
/usr/bin/serial-split
|
/usr/bin/serial-split
|
||||||
/usr/include/blktaplib.h
|
|
||||||
/usr/include/fsimage*
|
|
||||||
/usr/include/xen*.h
|
|
||||||
/usr/include/xen/
|
|
||||||
/usr/include/xs.h
|
|
||||||
/usr/include/xs_lib.h
|
|
||||||
/usr/include/libxl.h
|
|
||||||
/usr/include/_libxl_types.h
|
|
||||||
/usr/include/libxl_uuid.h
|
|
||||||
|
|
||||||
%files doc-html
|
%files doc-html
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
@ -1110,12 +1072,36 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_defaultdocdir}/xen/pdf
|
%{_defaultdocdir}/xen/pdf
|
||||||
|
|
||||||
%clean
|
|
||||||
#test ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT
|
|
||||||
#rm -rf $RPM_BUILD_DIR/%xen_build_dir
|
|
||||||
|
|
||||||
%post tools
|
%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}
|
%{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_and_insserv -y -n xendomains xendomains}
|
||||||
if [ -f /usr/bin/qemu-img ]; then
|
if [ -f /usr/bin/qemu-img ]; then
|
||||||
if [ -f /usr/bin/qemu-img-xen ]; then
|
if [ -f /usr/bin/qemu-img-xen ]; then
|
||||||
@ -1131,10 +1117,13 @@ if [ -f /usr/bin/qemu-nbd ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%preun tools
|
%preun tools
|
||||||
%{stop_on_removal xendomains xend}
|
%{stop_on_removal xendomains xend xencommons}
|
||||||
|
|
||||||
%postun tools
|
%postun tools
|
||||||
|
%if %{?with_xend}0
|
||||||
|
# with_xend
|
||||||
%{restart_on_update xend}
|
%{restart_on_update xend}
|
||||||
|
%endif
|
||||||
%{insserv_cleanup}
|
%{insserv_cleanup}
|
||||||
if [ -f /usr/bin/qemu-img-xen ]; then
|
if [ -f /usr/bin/qemu-img-xen ]; then
|
||||||
rm /usr/bin/qemu-img-xen
|
rm /usr/bin/qemu-img-xen
|
||||||
@ -1143,10 +1132,8 @@ if [ -f /usr/bin/qemu-nbd-xen ]; then
|
|||||||
rm /usr/bin/qemu-nbd-xen
|
rm /usr/bin/qemu-nbd-xen
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%post libs
|
%post libs -p /sbin/ldconfig
|
||||||
/sbin/ldconfig
|
|
||||||
|
|
||||||
%postun libs
|
%postun libs -p /sbin/ldconfig
|
||||||
/sbin/ldconfig
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
@ -282,3 +282,102 @@ Index: xen-4.1.0-testing/tools/hotplug/Linux/vm-monitor
|
|||||||
+elif [ $0 = "$basedir/vm-monitor" ]; then
|
+elif [ $0 = "$basedir/vm-monitor" ]; then
|
||||||
+ monitor $*
|
+ monitor $*
|
||||||
+fi
|
+fi
|
||||||
|
Index: xen-4.1.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||||
|
===================================================================
|
||||||
|
--- xen-4.1.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||||
|
+++ xen-4.1.0-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||||
|
@@ -470,6 +470,7 @@ class XendDomainInfo:
|
||||||
|
|
||||||
|
if self._stateGet() in (XEN_API_VM_POWER_STATE_HALTED, XEN_API_VM_POWER_STATE_SUSPENDED, XEN_API_VM_POWER_STATE_CRASHED):
|
||||||
|
try:
|
||||||
|
+ self.acquire_running_lock();
|
||||||
|
XendTask.log_progress(0, 30, self._constructDomain)
|
||||||
|
XendTask.log_progress(31, 60, self._initDomain)
|
||||||
|
|
||||||
|
@@ -2984,6 +2985,11 @@ class XendDomainInfo:
|
||||||
|
|
||||||
|
self._stateSet(DOM_STATE_HALTED)
|
||||||
|
self.domid = None # Do not push into _stateSet()!
|
||||||
|
+
|
||||||
|
+ try:
|
||||||
|
+ self.release_running_lock()
|
||||||
|
+ except:
|
||||||
|
+ log.exception("Failed to release domain lock.")
|
||||||
|
finally:
|
||||||
|
self.refresh_shutdown_lock.release()
|
||||||
|
|
||||||
|
@@ -4491,6 +4497,74 @@ class XendDomainInfo:
|
||||||
|
def has_device(self, dev_class, dev_uuid):
|
||||||
|
return (dev_uuid in self.info['%s_refs' % dev_class.lower()])
|
||||||
|
|
||||||
|
+ # Return name of host contained in lock file.
|
||||||
|
+ def get_lock_host(self, path):
|
||||||
|
+ fin = os.popen(xoptions.get_xend_domain_lock_utility() + \
|
||||||
|
+ ' -s ' + path, 'r')
|
||||||
|
+ hostname = "unknown"
|
||||||
|
+
|
||||||
|
+ try:
|
||||||
|
+ tokens = fin.readline().split()
|
||||||
|
+ for token in tokens:
|
||||||
|
+ item = token.split('=')
|
||||||
|
+ if item[0] == 'host':
|
||||||
|
+ hostname = item[1]
|
||||||
|
+ return hostname
|
||||||
|
+ finally:
|
||||||
|
+ fin.close()
|
||||||
|
+
|
||||||
|
+ # Acquire a lock for the domain. No-op if domain locking is turned off.
|
||||||
|
+ def acquire_running_lock(self):
|
||||||
|
+ if not xoptions.get_xend_domain_lock():
|
||||||
|
+ return
|
||||||
|
+
|
||||||
|
+ log.debug("Acquiring lock for domain %s" % self.info['name_label'])
|
||||||
|
+ path = xoptions.get_xend_domain_lock_path()
|
||||||
|
+ path = os.path.join(path, self.get_uuid())
|
||||||
|
+
|
||||||
|
+ try:
|
||||||
|
+ if not os.path.exists(path):
|
||||||
|
+ mkdir.parents(path, stat.S_IRWXU)
|
||||||
|
+ except:
|
||||||
|
+ log.exception("%s could not be created." % path)
|
||||||
|
+ raise XendError("%s could not be created." % path)
|
||||||
|
+
|
||||||
|
+ status = os.system('%s -l -p %s -n %s -i %s %s' % \
|
||||||
|
+ (xoptions.get_xend_domain_lock_utility(), \
|
||||||
|
+ XendNode.instance().get_name(), \
|
||||||
|
+ self.info['name_label'], \
|
||||||
|
+ self.info['uuid'], \
|
||||||
|
+ path))
|
||||||
|
+ if status != 0:
|
||||||
|
+ log.debug("Failed to aqcuire lock: status = %d" % status)
|
||||||
|
+ raise XendError("The VM is locked and appears to be running on host %s." % self.get_lock_host(path))
|
||||||
|
+
|
||||||
|
+ # Release lock for domain. No-op if domain locking is turned off.
|
||||||
|
+ def release_running_lock(self, name = None):
|
||||||
|
+ if not xoptions.get_xend_domain_lock():
|
||||||
|
+ return
|
||||||
|
+
|
||||||
|
+ dom_name = self.info['name_label']
|
||||||
|
+ if name:
|
||||||
|
+ dom_name = name
|
||||||
|
+ log.debug("Releasing lock for domain %s" % dom_name)
|
||||||
|
+
|
||||||
|
+ path = xoptions.get_xend_domain_lock_path()
|
||||||
|
+ path = os.path.join(path, self.get_uuid())
|
||||||
|
+ status = os.system('%s -u -p %s -n %s -i %s %s' % \
|
||||||
|
+ (xoptions.get_xend_domain_lock_utility(), \
|
||||||
|
+ XendNode.instance().get_name(), \
|
||||||
|
+ dom_name, \
|
||||||
|
+ self.info['uuid'], \
|
||||||
|
+ path))
|
||||||
|
+ if status != 0:
|
||||||
|
+ log.exception("Failed to release lock: status = %s" % status)
|
||||||
|
+ try:
|
||||||
|
+ if len(os.listdir(path)) == 0:
|
||||||
|
+ shutil.rmtree(path)
|
||||||
|
+ except:
|
||||||
|
+ log.exception("Failed to remove unmanaged directory %s." % path)
|
||||||
|
+
|
||||||
|
def __str__(self):
|
||||||
|
return '<domain id=%s name=%s memory=%s state=%s>' % \
|
||||||
|
(str(self.domid), self.info['name_label'],
|
||||||
|
@ -36,6 +36,7 @@ PART=2
|
|||||||
DOMU_IS_FILE_BASED=
|
DOMU_IS_FILE_BASED=
|
||||||
DOMU_ROOTDEV=
|
DOMU_ROOTDEV=
|
||||||
FORCE=no
|
FORCE=no
|
||||||
|
xm_cmd=xl
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -481,11 +482,11 @@ fi
|
|||||||
#
|
#
|
||||||
# Make sure that the source VM is not running
|
# Make sure that the source VM is not running
|
||||||
#
|
#
|
||||||
xmid=`xm domid "$SOURCE" 2>/dev/null`
|
xmid=`${xm_cmd} domid "$SOURCE" 2>/dev/null`
|
||||||
if [ $? -eq 0 ] && [ -n "$xmid" ] && [ -z "${xmid//[[:digit:]]/}" ]
|
if [ $? -eq 0 ] && [ -n "$xmid" ] && [ -z "${xmid//[[:digit:]]/}" ]
|
||||||
then
|
then
|
||||||
echo "domU $SOURCE is currently running on Xen, please shutdown before cloning." >&2
|
echo "domU $SOURCE is currently running on Xen, please shutdown before cloning." >&2
|
||||||
echo "The command \"xm shutdown $xmid -w\" will shutdown the domU" >&2
|
echo "The command \"${xm_cmd} shutdown $xmid -w\" will shutdown the domU" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user