[PATCH] fix spec file for sblim-sfcb and systemctl
by Daniel Veillard
Right now the spec file is completely tied to tog-pegasus,
this should allow the spec file to be compatible with sblim-sfcb
too. This also switches to systemctl which is now used in Fedora.
I would actually like some feedback on the patch if someone
has an environment to test with sblim-sfcb
Also I noted that if I built the package with sblim-sfcb installed
it failed in the make install phase with the following error:
----------------------------------------------------------
/bin/sh /u/veillard/rpms/BUILD/libvirt-cim-0.6.1/install-sh -c -m 644 -t
"/u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim"
./schema/RegisteredProfile.registration
./schema/ElementConformsToProfile.registration
./schema/ReferencedProfile.registration
if [[ sfcb != pegasus ]]; then \
sed -i '/^# --/,/^# --!/d'
.//u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim/RegisteredProfile.registration
.//u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim/ElementConformsToProfile.registration
.//u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim/ReferencedProfile.registration;
\
fi
sed: can't read
.//u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim/RegisteredProfile.registration:
No such file or directory
sed: can't read
.//u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim/ElementConformsToProfile.registration:
No such file or directory
sed: can't read
.//u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim/ReferencedProfile.registration:
No such file or directory
make[2]: *** [install-data-local] Error 2
make[2]: Leaving directory `/home/veillard/rpms/BUILD/libvirt-cim-0.6.1'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/veillard/rpms/BUILD/libvirt-cim-0.6.1'
make: *** [install-recursive] Error 1
----------------------------------------------------------
Any idea ?
thanks,
Daniel
--- libvirt-cim.spec 2012-02-10 13:49:31.679905149 +0800
+++ libvirt-cim.spec 2012-03-09 14:41:45.617781910 +0800
@@ -12,7 +12,8 @@
Requires: libxml2 >= 2.6.0
Requires: libvirt >= 0.9.0
Requires: unzip
-Requires: tog-pegasus
+# either tog-pegasus or sblim-sfcb should provide cim-server
+Requires: cim-server
BuildRequires: libcmpiutil >= 0.5.4
BuildRequires: tog-pegasus-devel
BuildRequires: libvirt-devel >= 0.9.0
@@ -85,8 +86,18 @@
%{_datadir}/%{name}/install_base_schema.sh %{_datadir}/%{name}
-/etc/init.d/tog-pegasus condrestart
+if [ "`systemctl is-active tog-pegasus.service`" = "active" ]
+then
+ systemctl restart tog-pegasus.service
+fi
+
+if [ "`systemctl is-active sblim-sfcb.service`" = "active" ]
+then
+ systemctl restart sblim-sfcb.service
+fi
+if [ -x /usr/sbin/cimserver ]
+then
%{_datadir}/%{name}/provider-register.sh -t pegasus \
-n root/virt \
-r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
@@ -102,8 +113,29 @@
%{_datadir}/%{name}/provider-register.sh -t pegasus \
-n root/cimv2\
-r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true
+fi
+if [ -x /usr/sbin/sfcbd ]
+then
+%{_datadir}/%{name}/provider-register.sh -t sfcb \
+ -n root/virt \
+ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -t sfcb \
+ -n root/virt \
+ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -t sfcb \
+ -n root/interop \
+ -r %{INTEROP_REG} -m %{INTEROP_MOF} -v >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -t sfcb \
+ -n root/PG_InterOp \
+ -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} -v >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -t sfcb \
+ -n root/cimv2\
+ -r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true
+fi
%preun
+if [ -x /usr/sbin/cimserver ]
+then
%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n root/virt \
-r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
@@ -116,6 +148,22 @@
%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n root/cimv2 \
-r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true
+fi
+if [ -x /usr/sbin/sfcbd ]
+then
+%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
+ -n root/virt \
+ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
+ -n root/interop \
+ -r %{INTEROP_REG} -m %{INTEROP_MOF} >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
+ -n root/PG_InterOp \
+ -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
+ -n root/cimv2 \
+ -r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true
+fi
%postun -p /sbin/ldconfig
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
12 years, 5 months
[PATCHv2 0/3] Make Shutdown and Reboot state changes jobs
by Eduardo Lima (Etrunko)
From: "Eduardo Lima (Etrunko)" <eblima(a)br.ibm.com>
This code is based on the VSMigrationService for the job creation and on
ComputerSystemIndication for the job thread, which will listen for the
respective domain event to mark the job as finished.
I am still not able to test this feature in my environment, every call to
CBGetInstance fails with code error 100. This is happening in other places of
the codebase, not only the ComputerSystem provider, but also ElementConfors,
for instance. Please use the test case send in previous email for reference.
Differences from v1:
- Fix conditional causing Reqstate not being set
- Fix domain event id for shutdown
- Now instead of using the domain events for both shutdown and reboot, there is
an intermediate patch, that will deal with the shutdown case by polling for
the domain state until it reflects the desired state.
This workaround won't work for the reboot case, because is is not possible to
monitor the reboot event if not using the domain event callbacks. The third
patch of the series contains the complete solution for both cases.
Eduardo Lima (Etrunko) (3):
VSMigrationService: Move job state definitions to svpc_types.h
ComputerSystem: Make Shutdown state change a job
ComputerSystem: Reboot state change also a job
schema/ComputerSystem.mof | 9 ++
src/Virt_ComputerSystem.c | 304 +++++++++++++++++++++++++++++++++++++++--
src/Virt_VSMigrationService.c | 14 +--
src/svpc_types.h | 13 ++
4 files changed, 321 insertions(+), 19 deletions(-)
--
1.7.7.6
12 years, 6 months