Compare commits

..

No commits in common. "master" and "upstream" have entirely different histories.

8 changed files with 18 additions and 287 deletions

View File

@ -1,107 +0,0 @@
#!/bin/sh
#
# fence_virtd Virtual Machine Fencing host daemon.
#
# chkconfig: 2345 98 01
# description: Fence_virtd is a fencing host daemon which routes fencing \
# requests from clusters of virtual machines to various \
# management layers.
# processname: fence_virtd
# config: /etc/fence_virt.conf
# pidfile: /var/run/fence_virtd.pid
### BEGIN INIT INFO
# Provides: fence_virtd
# Required-Start: network
# Required-Stop:
# Should-Start: libvirtd
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: start and stop fence_virtd
# description: Fence_virtd handles fencing requests from VMs
### end init info
# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
SERVICE=fence_virtd
PIDFILE=/var/run/$SERVICE.pid
LOCKFILE=/var/lock/subsys/$SERVICE
FENCE_VIRTD_ARGS="-w"
SourceIfNotEmpty /etc/sysconfig/fence_virtd
RETVAL=0
start()
{
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- "$SERVICE" $FENCE_VIRTD_ARGS
RETVAL=$?
return $RETVAL
}
stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- "$SERVICE"
RETVAL=$?
return $RETVAL
}
restart()
{
stop
start
}
reload()
{
msg_reloading "$SERVICE"
stop_daemon --pidfile "$PIDFILE" --expect-user root -HUP -- "$SERVICE"
RETVAL=$?
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
condreload)
if [ -e "$LOCKFILE" ]; then
reload
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user root -- "$SERVICE"
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
RETVAL=1
esac
exit $RETVAL

View File

@ -1,3 +0,0 @@
copy?: .gear/*.init
tar: .

View File

@ -1,3 +0,0 @@
[remote "upstream"]
url = https://github.com/ClusterLabs/fence-virt.git
fetch = +refs/heads/*:refs/remotes/upstream/*

View File

@ -4,7 +4,7 @@ CXX=@CXX@
CFLAGS=@CFLAGS@
CFLAGS+=-Wall -Wformat=2 -Wstrict-prototypes -Wshadow -D_GNU_SOURCE
CXXFLAGS=@CXXFLAGS@
CXXFLAGS+=-Wall -fPIC -Wformat=2 -Wstrict-prototypes -Wshadow -D_GNU_SOURCE
CXXFLAGS+=-Wall -Wformat=2 -Wstrict-prototypes -Wshadow -D_GNU_SOURCE
LEX=@LEX@
YACC=@YACC@

View File

@ -40,10 +40,10 @@ fence_xvm: ${TARGET}
ln -snf $^ $@
fence_virt: ${fence_virt_SOURCES:.c=.o}
$(CC) $(CFLAGS) $(LDFLAGS) -pie -o $@ $^ $(LIBS) -L../common -lfence_virt
$(CC) $(CFLAGS) -pie -o $@ $^ $(LIBS) -L../common -lfence_virt
%.o: %.c
$(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
$(CC) $(CFLAGS) -c -o $@ $^ $(INCLUDES)
install: all
if [ ! -d ${DESTDIR}/${sbindir} ]; then \

View File

@ -37,7 +37,7 @@ tcp.o: tcp.c
$(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
%.o: %.c
$(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
$(CC) $(CFLAGS) -c -o $@ $^ $(INCLUDES)
clean:
rm -f ${TARGETS} *~ *.o testprog

View File

@ -1,156 +0,0 @@
%define _unpackaged_files_terminate_build 1
# like subst_with, but replacing '_' with '-'
%define subst_enable_dash() %{expand:%%(echo '%%{subst_enable %1}' | sed 's/_/-/g')}
%def_enable cpg_plugin
%def_disable libvirt_qmf_plugin
%global commit c2ca768a8e57a73b5ec2899305439122285aa4a9
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: fence-virt
Version: 0.4.0
Release: alt0.1.%shortcommit
Summary: A pluggable fencing framework for virtual machines
License: GPLv2+
Group: System/Base
Url: http://fence-virt.sourceforge.net
Source0: %name-%version.tar
Source11: fence_virtd.init
BuildRequires: gcc-c++
BuildRequires: libcorosync-devel libvirt-devel
BuildRequires: libxml2-devel nss-devel nspr-devel
BuildRequires: flex libuuid-devel
%description
Fencing agent for virtual machines.
%package -n fence-virtd
Summary: Daemon which handles requests from fence-virt
Group: System/Base
%description -n fence-virtd
This package provides the host server framework, fence_virtd,
for fence_virt. The fence_virtd host daemon is resposible for
processing fencing requests from virtual machines and routing
the requests to the appropriate physical machine for action.
%package -n fence-virtd-multicast
Summary: Multicast listener for fence-virtd
Requires: fence-virtd
Group: System/Base
%description -n fence-virtd-multicast
Provides multicast listener capability for fence-virtd.
%package -n fence-virtd-serial
Summary: Serial VMChannel listener for fence-virtd
Requires: libvirt >= 0.6.2
Requires: fence-virtd
Group: System/Base
%description -n fence-virtd-serial
Provides serial VMChannel listener capability for fence-virtd.
%package -n fence-virtd-tcp
Summary: TCP listener for fence-virtd
Requires: fence-virtd
Group: System/Base
%description -n fence-virtd-tcp
Provides TCP listener capability for fence-virtd.
%package -n fence-virtd-vsock
Summary: VSOCK listener for fence-virtd
Requires: fence-virtd
Group: System/Base
%description -n fence-virtd-vsock
Provides VSOCK listener capability for fence-virtd.
%package -n fence-virtd-libvirt
Summary: Libvirt backend for fence-virtd
Requires: libvirt >= 0.6.0
Requires: fence-virtd
Group: System/Base
%description -n fence-virtd-libvirt
Provides fence_virtd with a connection to libvirt to fence
virtual machines. Useful for running a cluster of virtual
machines on a desktop.
%package -n fence-virtd-cpg
Summary: CPG/libvirt backend for fence-virtd
Requires: fence-virtd
Group: System/Base
%description -n fence-virtd-cpg
Provides fence_virtd with a connection to libvirt to fence
virtual machines. Uses corosync CPG to keep track of VM
locations to allow for non-local VMs to be fenced when VMs
are located on corosync cluster nodes.
%prep
%setup
%build
#%autoreconf
./autogen.sh
%configure %{subst_enable_dash cpg_plugin} %{subst_enable_dash libvirt_qmf_plugin}
%make_build
%install
%makeinstall_std
# Systemd unit file
mkdir -p %buildroot{%_unitdir,%_initdir}
install -m 0644 fence_virtd.service %buildroot%_unitdir/
install -m 0755 %SOURCE11 %buildroot%_initdir/fence_virtd
%post
%post_service fence_virtd
%preun
%preun_service fence_virtd
%files
%doc COPYING TODO README
%_sbindir/fence_virt
%_sbindir/fence_xvm
%_man8dir/fence_virt.*
%_man8dir/fence_xvm.*
%files -n fence-virtd
%_sbindir/fence_virtd
%_unitdir/fence_virtd.service
%_initdir/fence_virtd
%config(noreplace) %_sysconfdir/fence_virt.conf
%dir %_libdir/%name
%_man5dir/fence_virt.conf.*
%_man8dir/fence_virtd.*
%files -n fence-virtd-multicast
%_libdir/%name/multicast.so
%files -n fence-virtd-serial
%_libdir/%name/serial.so
%files -n fence-virtd-tcp
%_libdir/%name/tcp.so
%files -n fence-virtd-vsock
%_libdir/%name/vsock.so
%files -n fence-virtd-libvirt
%_libdir/%name/libvirt.so
%files -n fence-virtd-cpg
%_libdir/%name/cpg.so
%changelog
* Tue May 07 2019 Andrew A. Vasilyev <andy@altlinux.org> 0.4.0-alt0.1.c2ca768
- master snapshot c2ca768a8e57a73b5ec2899305439122285aa4a9

View File

@ -159,46 +159,46 @@ endif
all: ${TARGETS} ${MODULES}
fence_virtd: ${fence_virtd_SOURCES:.c=.o} ${fence_virtd_cxx_SOURCES:.cpp=.opp}
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(MAIN_LIBS) $(LIBS)
$(CXX) $(CXXFLAGS) -o $@ $^ $(MAIN_LIBS) $(LIBS)
multicast.so: ${multicast_so_SOURCES:.c=.o}
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) -shared $(NSS_LIBS)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(NSS_LIBS)
libvirt.so: ${libvirt_so_SOURCES:.c=.o}
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS)
libvirt-qmf.so: ${libvirt_qmf_so_SOURCES:.c=.o} ${libvirt_qmf_cxx_so_SOURCES:.cpp=.opp}
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) -shared $(VIRT_QPID)
$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS) -shared $(VIRT_QPID)
pm-fence.so: ${pm_fence_so_SOURCES:.c=.o}
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) -shared $(PACEMAKER_LIBS)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(PACEMAKER_LIBS)
cpg.so: ${cpg_so_SOURCES:.c=.o}
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS) $(XML_LIBS) $(COROSYNC_LIBS)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS) $(XML_LIBS) $(COROSYNC_LIBS)
null.so: ${null_so_SOURCES:.c=.o}
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) -shared
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared
serial.so: ${serial_so_SOURCES:.c=.o}
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS) $(XML_LIBS)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(VIRT_LIBS) $(UUID_LIBS) $(XML_LIBS)
tcp.so: ${tcp_so_SOURCES:.c=.o}
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) -shared $(NSS_LIBS)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(NSS_LIBS)
vsock.so: ${vsock_so_SOURCES:.c=.o}
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) -shared $(NSS_LIBS)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) -shared $(NSS_LIBS)
cpg-virt.o: cpg-virt.c
$(CC) $(CFLAGS) $(LDFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
$(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
virt.o: virt.c
$(CC) $(CFLAGS) $(LDFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
$(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
virt-serial.o: virt-serial.c
$(CC) $(CFLAGS) $(LDFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
$(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
%.o: %.c
$(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(INCLUDES)
$(CC) $(CFLAGS) -c -o $@ $^ $(INCLUDES)
%.opp: %.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $^ $(INCLUDES)