diff options
author | Radek Novacek <rnovacek@redhat.com> | 2013-10-30 15:51:12 +0100 |
---|---|---|
committer | Radek Novacek <rnovacek@redhat.com> | 2013-10-31 08:53:46 +0100 |
commit | 49394a84fe1235b692fc32d903bf3486e41f76b4 (patch) | |
tree | e702181ad69ea995e48ce103f1f3e2b90fa97597 /src/power/LMI_PowerManagementServiceProvider.c | |
parent | 793843369a4445f8602ef176b41c828730cb4404 (diff) | |
download | openlmi-providers-49394a84fe1235b692fc32d903bf3486e41f76b4.tar.gz openlmi-providers-49394a84fe1235b692fc32d903bf3486e41f76b4.tar.xz openlmi-providers-49394a84fe1235b692fc32d903bf3486e41f76b4.zip |
Add lmi_get_computer_system function and fix lmi_get_system_name
PG_ComputerSystem has different method how to get hostname than our
providers. In order to create the associations to this class we need to
enumerate it. The downside is that all providers must supply CMPIContext
to the lmi_init function.
New function lmi_get_computer_system returns CMPIObjectPath to the
configured CIM_ComputerSystem subclass instance. This object should be
used in all references with ComputerSystem.
Function lmi_get_system_name has been altered to return same value as
ComputerSystem "Name" property.
Diffstat (limited to 'src/power/LMI_PowerManagementServiceProvider.c')
-rw-r--r-- | src/power/LMI_PowerManagementServiceProvider.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/power/LMI_PowerManagementServiceProvider.c b/src/power/LMI_PowerManagementServiceProvider.c index 00aebb2..f5256bd 100644 --- a/src/power/LMI_PowerManagementServiceProvider.c +++ b/src/power/LMI_PowerManagementServiceProvider.c @@ -25,14 +25,16 @@ static const CMPIBroker* _cb = NULL; -static void LMI_PowerManagementServiceInitialize(CMPIInstanceMI *mi) +static void LMI_PowerManagementServiceInitialize(CMPIInstanceMI *mi, + const CMPIContext *ctx) { - mi->hdl = power_ref(_cb); + mi->hdl = power_ref(_cb, ctx); } -static void LMI_PowerManagementServiceMethodInitialize(CMPIMethodMI *mi) +static void LMI_PowerManagementServiceMethodInitialize(CMPIMethodMI *mi, + const CMPIContext *ctx) { - mi->hdl = power_ref(_cb); + mi->hdl = power_ref(_cb, ctx); } @@ -150,7 +152,7 @@ CMInstanceMIStub( LMI_PowerManagementService, LMI_PowerManagementService, _cb, - LMI_PowerManagementServiceInitialize(&mi)) + LMI_PowerManagementServiceInitialize(&mi, ctx)) static CMPIStatus LMI_PowerManagementServiceMethodCleanup( CMPIMethodMI* mi, @@ -179,7 +181,7 @@ CMMethodMIStub( LMI_PowerManagementService, LMI_PowerManagementService, _cb, - LMI_PowerManagementServiceMethodInitialize(&mi)) + LMI_PowerManagementServiceMethodInitialize(&mi, ctx)) KUint32 LMI_PowerManagementService_RequestStateChange( const CMPIBroker* cb, |