summaryrefslogtreecommitdiffstats
path: root/src/power
diff options
context:
space:
mode:
Diffstat (limited to 'src/power')
-rw-r--r--src/power/CMakeLists.txt2
-rw-r--r--src/power/LMI_AssociatedPowerManagementServiceProvider.c2
-rw-r--r--src/power/LMI_ElementCapabilitiesProvider.c3
-rw-r--r--src/power/LMI_HostedPowerManagementServiceProvider.c2
-rw-r--r--src/power/LMI_PowerConcreteJobProvider.c3
-rw-r--r--src/power/LMI_PowerManagementCapabilitiesProvider.c2
-rw-r--r--src/power/LMI_PowerManagementServiceProvider.c2
-rw-r--r--src/power/power.c24
-rw-r--r--src/power/power.h3
9 files changed, 15 insertions, 28 deletions
diff --git a/src/power/CMakeLists.txt b/src/power/CMakeLists.txt
index 44b2109..0519c4a 100644
--- a/src/power/CMakeLists.txt
+++ b/src/power/CMakeLists.txt
@@ -43,7 +43,7 @@ endif (${SYSTEMCTL_FOUND})
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMPI_INCLUDE_DIR} ${GLIB_INCLUDE_DIRS})
-target_link_libraries(${LIBRARY_NAME} openlmicommon ${KONKRETCMPI_LIBRARIES} ${GLIB_LIBRARIES})
+target_link_libraries(${LIBRARY_NAME} openlmi ${KONKRETCMPI_LIBRARIES} ${GLIB_LIBRARIES})
# Create registration file
cim_registration(${PROVIDER_NAME} ${LIBRARY_NAME} ${MOF} share/openlmi-providers)
diff --git a/src/power/LMI_AssociatedPowerManagementServiceProvider.c b/src/power/LMI_AssociatedPowerManagementServiceProvider.c
index 74c426f..25cfc9c 100644
--- a/src/power/LMI_AssociatedPowerManagementServiceProvider.c
+++ b/src/power/LMI_AssociatedPowerManagementServiceProvider.c
@@ -21,10 +21,8 @@
#include "LMI_AssociatedPowerManagementService.h"
#include "LMI_PowerManagementService.h"
#include "CIM_ComputerSystem.h"
-
#include "power.h"
-#include "globals.h"
static const CMPIBroker* _cb;
diff --git a/src/power/LMI_ElementCapabilitiesProvider.c b/src/power/LMI_ElementCapabilitiesProvider.c
index 25c2865..7d7d58f 100644
--- a/src/power/LMI_ElementCapabilitiesProvider.c
+++ b/src/power/LMI_ElementCapabilitiesProvider.c
@@ -20,7 +20,6 @@
#include <konkret/konkret.h>
#include "LMI_ElementCapabilities.h"
-#include "globals.h"
#include "power.h"
static const CMPIBroker* _cb;
@@ -80,7 +79,7 @@ static CMPIStatus LMI_ElementCapabilitiesEnumInstances(
LMI_PowerManagementCapabilitiesRef powerManagementCapabilitiesRef;
LMI_PowerManagementCapabilitiesRef_Init(&powerManagementCapabilitiesRef, _cb, ns);
- LMI_PowerManagementCapabilitiesRef_Set_InstanceID(&powerManagementCapabilitiesRef, ORGID ":LMI_PowerManagementCapabilities");
+ LMI_PowerManagementCapabilitiesRef_Set_InstanceID(&powerManagementCapabilitiesRef, LMI_ORGID ":LMI_PowerManagementCapabilities");
LMI_ElementCapabilities_Set_Capabilities(&w, &powerManagementCapabilitiesRef);
diff --git a/src/power/LMI_HostedPowerManagementServiceProvider.c b/src/power/LMI_HostedPowerManagementServiceProvider.c
index 9663ed1..80f0111 100644
--- a/src/power/LMI_HostedPowerManagementServiceProvider.c
+++ b/src/power/LMI_HostedPowerManagementServiceProvider.c
@@ -21,8 +21,6 @@
#include <cmpimacs.h>
#include <konkret/konkret.h>
#include "LMI_HostedPowerManagementService.h"
-
-#include "globals.h"
#include "power.h"
static const CMPIBroker* _cb;
diff --git a/src/power/LMI_PowerConcreteJobProvider.c b/src/power/LMI_PowerConcreteJobProvider.c
index ef6e501..a4d09c8 100644
--- a/src/power/LMI_PowerConcreteJobProvider.c
+++ b/src/power/LMI_PowerConcreteJobProvider.c
@@ -21,7 +21,6 @@
#include <konkret/konkret.h>
#include <stdint.h>
#include "LMI_PowerConcreteJob.h"
-#include "globals.h"
static const CMPIBroker* _cb = NULL;
@@ -80,7 +79,7 @@ static CMPIStatus LMI_PowerConcreteJobEnumInstances(
powerStateChangeJob = plist->data;
LMI_PowerConcreteJob concreteJob;
LMI_PowerConcreteJob_Init(&concreteJob, _cb, ns);
- if (asprintf(&instanceid, ORGID ":LMI_PowerConcreteJob:%ld", job_id(powerStateChangeJob)) < 0) {
+ if (asprintf(&instanceid, LMI_ORGID ":LMI_PowerConcreteJob:%ld", job_id(powerStateChangeJob)) < 0) {
KReturn2(_cb, ERR_FAILED, "Memory allocation failed");
}
LMI_PowerConcreteJob_Set_InstanceID(&concreteJob, instanceid);
diff --git a/src/power/LMI_PowerManagementCapabilitiesProvider.c b/src/power/LMI_PowerManagementCapabilitiesProvider.c
index ca02083..c0ad710 100644
--- a/src/power/LMI_PowerManagementCapabilitiesProvider.c
+++ b/src/power/LMI_PowerManagementCapabilitiesProvider.c
@@ -69,7 +69,7 @@ static CMPIStatus LMI_PowerManagementCapabilitiesEnumInstances(
LMI_PowerManagementCapabilities w;
LMI_PowerManagementCapabilities_Init(&w, _cb, ns);
// TODO: make it unique
- LMI_PowerManagementCapabilities_Set_InstanceID(&w, ORGID ":LMI_PowerManagementCapabilities");
+ LMI_PowerManagementCapabilities_Set_InstanceID(&w, LMI_ORGID ":LMI_PowerManagementCapabilities");
LMI_PowerManagementCapabilities_Set_ElementName(&w, "PowerManagementCapabilities");
LMI_PowerManagementCapabilities_Set_Caption(&w, "Power Management Capabilities");
diff --git a/src/power/LMI_PowerManagementServiceProvider.c b/src/power/LMI_PowerManagementServiceProvider.c
index 9759b1c..162d798 100644
--- a/src/power/LMI_PowerManagementServiceProvider.c
+++ b/src/power/LMI_PowerManagementServiceProvider.c
@@ -19,9 +19,7 @@
*/
#include "LMI_PowerManagementService.h"
-
#include "power.h"
-#include "globals.h"
static const CMPIBroker* _cb = NULL;
diff --git a/src/power/power.c b/src/power/power.c
index 6ec24b6..cbd62a5 100644
--- a/src/power/power.c
+++ b/src/power/power.c
@@ -23,8 +23,6 @@
#include <stdlib.h>
#include <assert.h>
-#include <glib.h>
-
#ifdef HAS_GDBUS
# include <gio/gio.h>
@@ -41,8 +39,6 @@
#include "LMI_AssociatedPowerManagementService.h"
#include "LMI_PowerConcreteJob.h"
-#include "globals.h"
-
const char *provider_name = "powermanagement";
const ConfigEntry *provider_config_defaults = NULL;
@@ -137,7 +133,7 @@ Proxy *power_create_logind()
G_DBUS_PROXY_FLAGS_NONE, NULL, LOGIND_NAME, LOGIND_PATH,
LOGIND_INTERFACE, NULL, &err)) == NULL) {
- error("Unable to connect to logind via DBus: %s", err->message);
+ lmi_error("Unable to connect to logind via DBus: %s", err->message);
g_error_free(err);
return NULL;
}
@@ -145,7 +141,7 @@ Proxy *power_create_logind()
// the proxied object doesn't exist => don't use logind
if (g_dbus_proxy_get_cached_property_names(logind_proxy) == NULL) {
g_object_unref(logind_proxy);
- debug("Logind DBus interface is not available");
+ lmi_debug("Logind DBus interface is not available");
return NULL;
}
return logind_proxy;
@@ -164,7 +160,7 @@ bool power_call_logind(Proxy *proxy, const char *method)
g_variant_new("(b)", false), G_DBUS_CALL_FLAGS_NONE, -1, NULL,
&err)) == NULL) {
- error("Unable to call: %s", method, err->message);
+ lmi_error("Unable to call: %s", method, err->message);
g_error_free(err);
return false;
} else {
@@ -186,7 +182,7 @@ bool power_check_logind(Proxy *proxy, const char *method)
if ((result = g_dbus_proxy_call_sync(proxy, method, g_variant_new("()"),
G_DBUS_CALL_FLAGS_NONE, -1, NULL, &err)) == NULL) {
- error("Unable to call %s: %s", method, err->message);
+ lmi_error("Unable to call %s: %s", method, err->message);
g_error_free(err);
return false;
} else {
@@ -236,7 +232,7 @@ void *state_change_thread(void *data)
MUTEX_UNLOCK(powerStateChangeJob->power);
}
- debug("State change thread cancelled\n");
+ lmi_debug("State change thread cancelled\n");
return NULL;
}
@@ -313,7 +309,7 @@ void *state_change_thread(void *data)
powerStateChangeJob->timeOfLastChange = time(NULL);
MUTEX_UNLOCK(powerStateChangeJob);
- debug("State change thread finished\n");
+ lmi_debug("State change thread finished\n");
return NULL;
}
@@ -334,13 +330,13 @@ int power_request_power_state(Power *power, unsigned short state)
}
free(states);
if (!found) {
- error("Invalid state requested: %d\n", state);
+ lmi_error("Invalid state requested: %d\n", state);
return CMPI_RC_ERR_INVALID_PARAMETER;
}
PowerStateChangeJob *powerStateChangeJob = malloc(sizeof(PowerStateChangeJob));
if (powerStateChangeJob == NULL) {
- error("Memory allocation failed");
+ lmi_error("Memory allocation failed");
return CMPI_RC_ERR_FAILED;
}
powerStateChangeJob->id = job_max_id++;
@@ -379,7 +375,7 @@ int power_request_power_state(Power *power, unsigned short state)
powerStateChangeJob->thread = power->broker->xft->newThread(state_change_thread, powerStateChangeJob, 1);
power->jobs = g_list_append(power->jobs, powerStateChangeJob);
MUTEX_UNLOCK(power);
- debug("State change thread started\n");
+ lmi_debug("State change thread started\n");
return rc;
}
@@ -388,7 +384,7 @@ unsigned short *power_available_requested_power_states(Power *power, int *count)
{
unsigned short *list = malloc(17 * sizeof(unsigned short));
if (list == NULL) {
- error("Memory allocation failed");
+ lmi_error("Memory allocation failed");
return NULL;
}
int i = 0;
diff --git a/src/power/power.h b/src/power/power.h
index 48a9409..477484b 100644
--- a/src/power/power.h
+++ b/src/power/power.h
@@ -21,8 +21,7 @@
#ifndef POWER_H
#define POWER_H
-#include <glib.h>
-#include "globals.h"
+#include "openlmi.h"
const char *provider_name;
const ConfigEntry *provider_config_defaults;