summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadek Novacek <rnovacek@redhat.com>2013-07-26 10:46:56 +0200
committerRadek Novacek <rnovacek@redhat.com>2013-07-26 10:57:09 +0200
commitbeeb8c2d85909f4e04f84ab18b554fee0be1482c (patch)
tree0d7b259a1178fc3adca7e3cd070c6f3a98b977af
parent632000a15e3dc204ad55b83970e21710aae40671 (diff)
downloadopenlmi-providers-beeb8c2d85909f4e04f84ab18b554fee0be1482c.tar.gz
openlmi-providers-beeb8c2d85909f4e04f84ab18b554fee0be1482c.tar.xz
openlmi-providers-beeb8c2d85909f4e04f84ab18b554fee0be1482c.zip
power: various improvements
* class versions in the mof file * profile registration * selinux wrapper
-rw-r--r--mof/60_LMI_PowerManagement.mof19
-rw-r--r--src/power/90_LMI_PowerManagement_Profile.mof.skel27
-rw-r--r--src/power/CMakeLists.txt7
-rw-r--r--src/power/cmpiLMI_PowerManagement-cimprovagt23
4 files changed, 69 insertions, 7 deletions
diff --git a/mof/60_LMI_PowerManagement.mof b/mof/60_LMI_PowerManagement.mof
index 490ad03..e71ce1a 100644
--- a/mof/60_LMI_PowerManagement.mof
+++ b/mof/60_LMI_PowerManagement.mof
@@ -18,13 +18,15 @@
* Authors: Radek Novacek <rnovacek@redhat.com>
*/
-[ Provider("cmpi:cmpiLMI_PowerManagement") ]
+[ Provider("cmpi:cmpiLMI_PowerManagement"),
+ Version("0.1.0") ]
class LMI_PowerManagementService: CIM_PowerManagementService
{
};
[ Association,
- Provider("cmpi:cmpiLMI_PowerManagement") ]
+ Provider("cmpi:cmpiLMI_PowerManagement"),
+ Version("0.1.0") ]
class LMI_AssociatedPowerManagementService: CIM_AssociatedPowerManagementService
{
[ Override("ServiceProvided"), Max(1),
@@ -36,13 +38,15 @@ class LMI_AssociatedPowerManagementService: CIM_AssociatedPowerManagementService
CIM_ComputerSystem REF UserOfService;
};
-[ Provider("cmpi:cmpiLMI_PowerManagement") ]
+[ Provider("cmpi:cmpiLMI_PowerManagement"),
+ Version("0.1.0") ]
class LMI_PowerManagementCapabilities: CIM_PowerManagementCapabilities
{
};
[ Association,
- Provider("cmpi:cmpiLMI_PowerManagement") ]
+ Provider("cmpi:cmpiLMI_PowerManagement"),
+ Version("0.1.0") ]
class LMI_HostedPowerManagementService: CIM_HostedService
{
[ Override("Antecedent"), Min(1), Max(1),
@@ -54,12 +58,15 @@ class LMI_HostedPowerManagementService: CIM_HostedService
LMI_PowerManagementService REF Dependent;
};
-[ Provider("cmpi:cmpiLMI_PowerManagement") ]
+[ Provider("cmpi:cmpiLMI_PowerManagement"),
+ Version("0.1.0") ]
class LMI_PowerConcreteJob: CIM_ConcreteJob
{
};
-[ Provider("cmpi:cmpiLMI_PowerManagement"), Association ]
+[ Association,
+ Provider("cmpi:cmpiLMI_PowerManagement"),
+ Version("0.1.0") ]
class LMI_ElementCapabilities: CIM_ElementCapabilities
{
[ Key, Min(1), Description("The managed element.") ]
diff --git a/src/power/90_LMI_PowerManagement_Profile.mof.skel b/src/power/90_LMI_PowerManagement_Profile.mof.skel
new file mode 100644
index 0000000..b03c5bd
--- /dev/null
+++ b/src/power/90_LMI_PowerManagement_Profile.mof.skel
@@ -0,0 +1,27 @@
+instance of PG_ProviderProfileCapabilities
+{
+ CapabilityID = "@CLASS@";
+
+ ProviderModuleName = "cmpiLMI_PowerManagement";
+
+ ProviderName = "@CLASS@";
+
+ RegisteredProfile = 0;
+
+ OtherRegisteredProfile = "OpenLMI-PowerManagement";
+ OtherProfileOrganization = "OpenLMI";
+
+ ProfileVersion = "@VERSION@";
+
+ RegisteredSubProfiles = {
+ 3021
+ };
+
+ SubprofileVersions = {
+ "1.0.1"
+ };
+
+ ConformingElements = {
+ "@CLASS@"
+ };
+};
diff --git a/src/power/CMakeLists.txt b/src/power/CMakeLists.txt
index f4cb797..cb76fb0 100644
--- a/src/power/CMakeLists.txt
+++ b/src/power/CMakeLists.txt
@@ -2,6 +2,7 @@
set(PROVIDER_NAME PowerManagement)
set(LIBRARY_NAME cmpiLMI_${PROVIDER_NAME})
set(MOF 60_LMI_PowerManagement.mof)
+set(POWERMANAGEMENT_SCRIPT cmpiLMI_${PROVIDER_NAME}-cimprovagt)
set(provider_SRCS
power.c
@@ -19,6 +20,9 @@ add_library(${LIBRARY_NAME} SHARED
${CIM_HEADERS}
)
+set(TARGET_MOF "${CMAKE_BINARY_DIR}/mof/90_LMI_${PROVIDER_NAME}_Profile.mof")
+profile_mof_generate("90_LMI_${PROVIDER_NAME}_Profile.mof.skel" "${TARGET_MOF}" "${CIM_CLASSES}")
+
# Require GLib
pkg_check_modules(GLIB REQUIRED glib-2.0)
@@ -44,4 +48,5 @@ endif (${SYSTEMCTL_FOUND})
cim_registration(${PROVIDER_NAME} ${LIBRARY_NAME} ${MOF} share/openlmi-providers)
install(TARGETS ${LIBRARY_NAME} DESTINATION lib${LIB_SUFFIX}/cmpi/)
-
+install(PROGRAMS ${POWERMANAGEMENT_SCRIPT} DESTINATION libexec/pegasus)
+install(FILES ${TARGET_MOF} DESTINATION share/openlmi-providers/)
diff --git a/src/power/cmpiLMI_PowerManagement-cimprovagt b/src/power/cmpiLMI_PowerManagement-cimprovagt
new file mode 100644
index 0000000..4079cbb
--- /dev/null
+++ b/src/power/cmpiLMI_PowerManagement-cimprovagt
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# Copyright (C) 2012-2013 Red Hat, Inc. All rights reserved.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Authors: Roman Rakus <rrakus@redhat.com>
+#
+
+
+/usr/libexec/pegasus/cimprovagt "$@"