diff options
60 files changed, 272 insertions, 235 deletions
diff --git a/src/account/LMI_AccountCapabilitiesProvider.c b/src/account/LMI_AccountCapabilitiesProvider.c index 0aea405..9ea80c0 100644 --- a/src/account/LMI_AccountCapabilitiesProvider.c +++ b/src/account/LMI_AccountCapabilitiesProvider.c @@ -75,7 +75,7 @@ static CMPIStatus LMI_AccountCapabilitiesEnumInstances( size_t i; const char *nameSpace = KNameSpace(cop); - const char *hostname = get_system_name(); + const char *hostname = lmi_get_system_name(); LMI_EnabledAccountCapabilitiesRef_Init(&leacref, _cb, nameSpace); LMI_EnabledAccountCapabilitiesRef_Set_InstanceID(&leacref, @@ -96,7 +96,7 @@ static CMPIStatus LMI_AccountCapabilitiesEnumInstances( LMI_AccountRef_Init(&laref, _cb, nameSpace); LMI_AccountRef_Set_Name(&laref, aux_lu_get_str(lue, LU_USERNAME)); LMI_AccountRef_Set_SystemCreationClassName(&laref, - get_system_creation_class_name()); + lmi_get_system_creation_class_name()); LMI_AccountRef_Set_SystemName(&laref, hostname); LMI_AccountRef_Set_CreationClassName(&laref, LMI_Account_ClassName); diff --git a/src/account/LMI_AccountManagementServiceCapabilitiesProvider.c b/src/account/LMI_AccountManagementServiceCapabilitiesProvider.c index 84a0921..b41949a 100644 --- a/src/account/LMI_AccountManagementServiceCapabilitiesProvider.c +++ b/src/account/LMI_AccountManagementServiceCapabilitiesProvider.c @@ -63,12 +63,12 @@ static CMPIStatus LMI_AccountManagementServiceCapabilitiesEnumInstances( LMI_AccountManagementServiceCapabilities lamsc; const char *nameSpace = KNameSpace(cop); - const char *hostname = get_system_name(); + const char *hostname = lmi_get_system_name(); LMI_AccountManagementServiceRef_Init(&lamsref, _cb, nameSpace); LMI_AccountManagementServiceRef_Set_Name(&lamsref, LAMSNAME); LMI_AccountManagementServiceRef_Set_SystemCreationClassName(&lamsref, - get_system_creation_class_name()); + lmi_get_system_creation_class_name()); LMI_AccountManagementServiceRef_Set_SystemName(&lamsref, hostname); LMI_AccountManagementServiceRef_Set_CreationClassName(&lamsref, LMI_AccountManagementService_ClassName); diff --git a/src/account/LMI_AccountManagementServiceProvider.c b/src/account/LMI_AccountManagementServiceProvider.c index e0e6f89..652cd3a 100644 --- a/src/account/LMI_AccountManagementServiceProvider.c +++ b/src/account/LMI_AccountManagementServiceProvider.c @@ -88,7 +88,7 @@ static CMPIStatus LMI_AccountManagementServiceEnumInstances( { LMI_AccountManagementService lams; - const char *hostname = get_system_name(); + const char *hostname = lmi_get_system_name(); LMI_AccountManagementService_Init(&lams, _cb, KNameSpace(cop)); LMI_AccountManagementService_Set_CreationClassName(&lams, @@ -97,7 +97,7 @@ static CMPIStatus LMI_AccountManagementServiceEnumInstances( LMI_AccountManagementService_Set_Name(&lams, LAMSNAME); LMI_AccountManagementService_Set_ElementName(&lams, LAMSNAME); LMI_AccountManagementService_Set_SystemCreationClassName(&lams, - get_system_creation_class_name()); + lmi_get_system_creation_class_name()); LMI_AccountManagementService_Set_RequestedState(&lams, LMI_AccountManagementService_RequestedState_Not_Applicable); LMI_AccountManagementService_Set_EnabledState(&lams, @@ -402,7 +402,7 @@ KUint32 LMI_AccountManagementService_CreateAccount( const char *nameSpace = LMI_AccountManagementServiceRef_NameSpace( (LMI_AccountManagementServiceRef *) self); - const char *hostname = get_system_name(); + const char *hostname = lmi_get_system_name(); CMPIStatus st; CMPIEnumeration *instances = NULL; LMI_AccountRef Accountref; @@ -578,7 +578,7 @@ output: LMI_AccountRef_Set_Name(&Accountref, Name->chars); LMI_AccountRef_Set_SystemName(&Accountref, hostname); LMI_AccountRef_Set_SystemCreationClassName(&Accountref, - get_system_creation_class_name()); + lmi_get_system_creation_class_name()); LMI_AccountRef_Set_CreationClassName(&Accountref, LMI_Account_ClassName); AccountOP = LMI_AccountRef_ToObjectPath(&Accountref, &st); KRef_SetObjectPath(Account, AccountOP); diff --git a/src/account/LMI_AccountOnSystemProvider.c b/src/account/LMI_AccountOnSystemProvider.c index 9c5960b..879d969 100644 --- a/src/account/LMI_AccountOnSystemProvider.c +++ b/src/account/LMI_AccountOnSystemProvider.c @@ -74,7 +74,7 @@ static CMPIStatus LMI_AccountOnSystemEnumInstances( size_t i; const char *nameSpace = KNameSpace(cop); - const char *hostname = get_system_name(); + const char *hostname = lmi_get_system_name(); luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error); if (!luc) @@ -89,7 +89,7 @@ static CMPIStatus LMI_AccountOnSystemEnumInstances( lue = g_ptr_array_index(accounts, i); LMI_AccountRef_Init(&laref, _cb, nameSpace); - LMI_AccountRef_Set_SystemCreationClassName(&laref, get_system_creation_class_name()); + LMI_AccountRef_Set_SystemCreationClassName(&laref, lmi_get_system_creation_class_name()); LMI_AccountRef_Set_SystemName(&laref, hostname); LMI_AccountRef_Set_CreationClassName(&laref, LMI_Account_ClassName); diff --git a/src/account/LMI_AccountProvider.c b/src/account/LMI_AccountProvider.c index fcfde9e..fdb06ff 100644 --- a/src/account/LMI_AccountProvider.c +++ b/src/account/LMI_AccountProvider.c @@ -110,7 +110,7 @@ static CMPIStatus LMI_AccountEnumInstances( size_t i; const char *nameSpace = KNameSpace(cop); - const char *hostname = get_system_name(); + const char *hostname = lmi_get_system_name(); char *uid = NULL; long last_change, min_lifetime, max_lifetime, warn, inactive, expire; time_t last_login; @@ -132,7 +132,7 @@ static CMPIStatus LMI_AccountEnumInstances( LMI_Account_Init(&la, _cb, nameSpace); LMI_Account_Set_CreationClassName(&la, LMI_Account_ClassName); LMI_Account_Set_SystemName(&la, hostname); - LMI_Account_Set_SystemCreationClassName(&la, get_system_creation_class_name()); + LMI_Account_Set_SystemCreationClassName(&la, lmi_get_system_creation_class_name()); LMI_Account_Set_Name(&la, aux_lu_get_str(lue, LU_USERNAME)); LMI_Account_Init_OrganizationName(&la, 1); /* XXX */ diff --git a/src/account/LMI_AssignedAccountIdentityProvider.c b/src/account/LMI_AssignedAccountIdentityProvider.c index 80a8915..4d94c9b 100644 --- a/src/account/LMI_AssignedAccountIdentityProvider.c +++ b/src/account/LMI_AssignedAccountIdentityProvider.c @@ -73,7 +73,7 @@ static CMPIStatus LMI_AssignedAccountIdentityEnumInstances( size_t i; const char *nameSpace = KNameSpace(cop); - const char *hostname = get_system_name(); + const char *hostname = lmi_get_system_name(); char *uid = NULL; luc = lu_start(NULL, lu_user, NULL, NULL, lu_prompt_console_quiet, NULL, &error); @@ -95,7 +95,7 @@ static CMPIStatus LMI_AssignedAccountIdentityEnumInstances( LMI_AccountRef_Init(&laref, _cb, nameSpace); LMI_AccountRef_Set_Name(&laref, aux_lu_get_str(lue, LU_USERNAME)); LMI_AccountRef_Set_SystemName(&laref, hostname); - LMI_AccountRef_Set_SystemCreationClassName(&laref, get_system_creation_class_name()); + LMI_AccountRef_Set_SystemCreationClassName(&laref, lmi_get_system_creation_class_name()); LMI_AccountRef_Set_CreationClassName(&laref, LMI_Account_ClassName); LMI_AssignedAccountIdentity_Init(&laai, _cb, nameSpace); diff --git a/src/account/LMI_HostedAccountManagementServiceProvider.c b/src/account/LMI_HostedAccountManagementServiceProvider.c index 89fdcf3..ffe9b8e 100644 --- a/src/account/LMI_HostedAccountManagementServiceProvider.c +++ b/src/account/LMI_HostedAccountManagementServiceProvider.c @@ -62,12 +62,12 @@ static CMPIStatus LMI_HostedAccountManagementServiceEnumInstances( LMI_HostedAccountManagementService lhs; const char *nameSpace = KNameSpace(cop); - const char *hostname = get_system_name(); + const char *hostname = lmi_get_system_name(); LMI_AccountManagementServiceRef_Init(&lamsref, _cb, nameSpace); LMI_AccountManagementServiceRef_Set_Name(&lamsref, LAMSNAME); LMI_AccountManagementServiceRef_Set_SystemCreationClassName(&lamsref, - get_system_creation_class_name()); + lmi_get_system_creation_class_name()); LMI_AccountManagementServiceRef_Set_SystemName(&lamsref, hostname); LMI_AccountManagementServiceRef_Set_CreationClassName(&lamsref, LMI_AccountManagementService_ClassName); diff --git a/src/account/LMI_ServiceAffectsIdentityProvider.c b/src/account/LMI_ServiceAffectsIdentityProvider.c index 5d302a2..2cee1f7 100644 --- a/src/account/LMI_ServiceAffectsIdentityProvider.c +++ b/src/account/LMI_ServiceAffectsIdentityProvider.c @@ -74,12 +74,12 @@ static CMPIStatus LMI_ServiceAffectsIdentityEnumInstances( char *id = NULL; const char *nameSpace = KNameSpace(cop); - const char *hostname = get_system_name(); + const char *hostname = lmi_get_system_name(); LMI_AccountManagementServiceRef_Init(&lamsref, _cb, nameSpace); LMI_AccountManagementServiceRef_Set_Name(&lamsref, LAMSNAME); LMI_AccountManagementServiceRef_Set_SystemCreationClassName(&lamsref, - get_system_creation_class_name()); + lmi_get_system_creation_class_name()); LMI_AccountManagementServiceRef_Set_SystemName(&lamsref, hostname); LMI_AccountManagementServiceRef_Set_CreationClassName(&lamsref, LMI_AccountManagementService_ClassName); diff --git a/src/fan/LMI_FanAssociatedSensorProvider.c b/src/fan/LMI_FanAssociatedSensorProvider.c index 5879118..5b6f776 100644 --- a/src/fan/LMI_FanAssociatedSensorProvider.c +++ b/src/fan/LMI_FanAssociatedSensorProvider.c @@ -75,15 +75,15 @@ static CMPIStatus LMI_FanAssociatedSensorEnumInstances( LMI_FanRef_Init(&fan, _cb, ns); LMI_FanRef_Set_CreationClassName(&fan, "LMI_Fan"); LMI_FanRef_Set_DeviceID(&fan, sptr->device_id); - LMI_FanRef_Set_SystemCreationClassName(&fan, get_system_creation_class_name()); - LMI_FanRef_Set_SystemName(&fan, get_system_name()); + LMI_FanRef_Set_SystemCreationClassName(&fan, lmi_get_system_creation_class_name()); + LMI_FanRef_Set_SystemName(&fan, lmi_get_system_name()); LMI_FanSensorRef fanSensor; LMI_FanSensorRef_Init(&fanSensor, _cb, ns); LMI_FanSensorRef_Set_CreationClassName(&fanSensor, "LMI_FanSensor"); LMI_FanSensorRef_Set_DeviceID(&fanSensor, sptr->device_id); - LMI_FanSensorRef_Set_SystemCreationClassName(&fanSensor, get_system_creation_class_name()); - LMI_FanSensorRef_Set_SystemName(&fanSensor, get_system_name()); + LMI_FanSensorRef_Set_SystemCreationClassName(&fanSensor, lmi_get_system_creation_class_name()); + LMI_FanSensorRef_Set_SystemName(&fanSensor, lmi_get_system_name()); LMI_FanAssociatedSensor_Set_Antecedent(&w, &fanSensor); LMI_FanAssociatedSensor_Set_Dependent(&w, &fan); diff --git a/src/fan/LMI_FanProvider.c b/src/fan/LMI_FanProvider.c index 3d7145b..e2f0b0e 100644 --- a/src/fan/LMI_FanProvider.c +++ b/src/fan/LMI_FanProvider.c @@ -76,8 +76,8 @@ static CMPIStatus LMI_FanEnumInstances( LMI_Fan w; LMI_Fan_Init(&w, _cb, ns); LMI_Fan_Set_CreationClassName(&w, "LMI_Fan"); - LMI_Fan_Set_SystemCreationClassName(&w, get_system_creation_class_name()); - LMI_Fan_Set_SystemName(&w, get_system_name()); + LMI_Fan_Set_SystemCreationClassName(&w, lmi_get_system_creation_class_name()); + LMI_Fan_Set_SystemName(&w, lmi_get_system_name()); LMI_Fan_Set_DeviceID(&w, sptr->device_id); LMI_Fan_Set_Caption(&w, "Computer's fan"); diff --git a/src/fan/LMI_FanSensorProvider.c b/src/fan/LMI_FanSensorProvider.c index 0df31ff..beac931 100644 --- a/src/fan/LMI_FanSensorProvider.c +++ b/src/fan/LMI_FanSensorProvider.c @@ -71,8 +71,8 @@ static CMPIStatus LMI_FanSensorEnumInstances( LMI_FanSensor w; LMI_FanSensor_Init(&w, _cb, KNameSpace(cop)); LMI_FanSensor_Set_CreationClassName(&w, "LMI_FanSensor"); - LMI_FanSensor_Set_SystemCreationClassName(&w, get_system_creation_class_name()); - LMI_FanSensor_Set_SystemName(&w, get_system_name()); + LMI_FanSensor_Set_SystemCreationClassName(&w, lmi_get_system_creation_class_name()); + LMI_FanSensor_Set_SystemName(&w, lmi_get_system_name()); LMI_FanSensor_Set_DeviceID(&w, sptr->device_id); LMI_FanSensor_Set_Caption(&w, "Computer's fan"); diff --git a/src/hardware/LMI_AssociatedProcessorCacheMemoryProvider.c b/src/hardware/LMI_AssociatedProcessorCacheMemoryProvider.c index 9c627a9..23cf5cd 100644 --- a/src/hardware/LMI_AssociatedProcessorCacheMemoryProvider.c +++ b/src/hardware/LMI_AssociatedProcessorCacheMemoryProvider.c @@ -133,8 +133,8 @@ static CMPIStatus LMI_AssociatedProcessorCacheMemoryEnumInstances( LMI_ProcessorRef_Init(&lmi_cpu, _cb, ns); LMI_ProcessorRef_Set_SystemCreationClassName(&lmi_cpu, - get_system_creation_class_name()); - LMI_ProcessorRef_Set_SystemName(&lmi_cpu, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_ProcessorRef_Set_SystemName(&lmi_cpu, lmi_get_system_name()); LMI_ProcessorRef_Set_CreationClassName(&lmi_cpu, LMI_ORGID "_" CPU_CLASS_NAME); LMI_ProcessorRef_Set_DeviceID(&lmi_cpu, dmi_cpus[i].id); @@ -150,9 +150,9 @@ static CMPIStatus LMI_AssociatedProcessorCacheMemoryEnumInstances( LMI_ProcessorCacheMemoryRef_Init(&lmi_cpu_cache, _cb, ns); LMI_ProcessorCacheMemoryRef_Set_SystemCreationClassName( - &lmi_cpu_cache, get_system_creation_class_name()); + &lmi_cpu_cache, lmi_get_system_creation_class_name()); LMI_ProcessorCacheMemoryRef_Set_SystemName(&lmi_cpu_cache, - get_system_name()); + lmi_get_system_name()); LMI_ProcessorCacheMemoryRef_Set_CreationClassName( &lmi_cpu_cache, LMI_ORGID "_" CPU_CACHE_CLASS_NAME); LMI_ProcessorCacheMemoryRef_Set_DeviceID( @@ -214,9 +214,9 @@ static CMPIStatus LMI_AssociatedProcessorCacheMemoryEnumInstances( LMI_ProcessorCacheMemoryRef_Init(&lmi_cpu_cache, _cb, ns); LMI_ProcessorCacheMemoryRef_Set_SystemCreationClassName( - &lmi_cpu_cache, get_system_creation_class_name()); + &lmi_cpu_cache, lmi_get_system_creation_class_name()); LMI_ProcessorCacheMemoryRef_Set_SystemName(&lmi_cpu_cache, - get_system_name()); + lmi_get_system_name()); LMI_ProcessorCacheMemoryRef_Set_CreationClassName(&lmi_cpu_cache, LMI_ORGID "_" CPU_CACHE_CLASS_NAME); LMI_ProcessorCacheMemoryRef_Set_DeviceID(&lmi_cpu_cache, @@ -227,8 +227,8 @@ static CMPIStatus LMI_AssociatedProcessorCacheMemoryEnumInstances( LMI_ProcessorRef_Init(&lmi_cpu, _cb, ns); LMI_ProcessorRef_Set_SystemCreationClassName(&lmi_cpu, - get_system_creation_class_name()); - LMI_ProcessorRef_Set_SystemName(&lmi_cpu, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_ProcessorRef_Set_SystemName(&lmi_cpu, lmi_get_system_name()); LMI_ProcessorRef_Set_CreationClassName(&lmi_cpu, LMI_ORGID "_" CPU_CLASS_NAME); diff --git a/src/hardware/LMI_BatteryProvider.c b/src/hardware/LMI_BatteryProvider.c index 4996c8e..0907bbc 100644 --- a/src/hardware/LMI_BatteryProvider.c +++ b/src/hardware/LMI_BatteryProvider.c @@ -72,8 +72,8 @@ static CMPIStatus LMI_BatteryEnumInstances( LMI_Battery_Init(&lmi_batt, _cb, ns); LMI_Battery_Set_SystemCreationClassName(&lmi_batt, - get_system_creation_class_name()); - LMI_Battery_Set_SystemName(&lmi_batt, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_Battery_Set_SystemName(&lmi_batt, lmi_get_system_name()); LMI_Battery_Set_CreationClassName(&lmi_batt, LMI_ORGID "_" BATTERY_CLASS_NAME); LMI_Battery_Set_BatteryStatus(&lmi_batt, diff --git a/src/hardware/LMI_BatterySystemDeviceProvider.c b/src/hardware/LMI_BatterySystemDeviceProvider.c index 90a2076..c3d465c 100644 --- a/src/hardware/LMI_BatterySystemDeviceProvider.c +++ b/src/hardware/LMI_BatterySystemDeviceProvider.c @@ -71,8 +71,8 @@ static CMPIStatus LMI_BatterySystemDeviceEnumInstances( LMI_BatteryRef_Init(&lmi_batt, _cb, ns); LMI_BatteryRef_Set_SystemCreationClassName(&lmi_batt, - get_system_creation_class_name()); - LMI_BatteryRef_Set_SystemName(&lmi_batt, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_BatteryRef_Set_SystemName(&lmi_batt, lmi_get_system_name()); LMI_BatteryRef_Set_CreationClassName(&lmi_batt, LMI_ORGID "_" BATTERY_CLASS_NAME); LMI_BatteryRef_Set_DeviceID(&lmi_batt, dmi_batt[i].name); diff --git a/src/hardware/LMI_DiskDriveATAPortProvider.c b/src/hardware/LMI_DiskDriveATAPortProvider.c index 56a1aa7..626d5f2 100644 --- a/src/hardware/LMI_DiskDriveATAPortProvider.c +++ b/src/hardware/LMI_DiskDriveATAPortProvider.c @@ -83,8 +83,8 @@ static CMPIStatus LMI_DiskDriveATAPortEnumInstances( LMI_DiskDriveATAPort_Init(&lmi_hdd_ata_port, _cb, ns); LMI_DiskDriveATAPort_Set_SystemCreationClassName(&lmi_hdd_ata_port, - get_system_creation_class_name()); - LMI_DiskDriveATAPort_Set_SystemName(&lmi_hdd_ata_port, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_DiskDriveATAPort_Set_SystemName(&lmi_hdd_ata_port, lmi_get_system_name()); LMI_DiskDriveATAPort_Set_CreationClassName(&lmi_hdd_ata_port, LMI_ORGID "_" DISK_DRIVE_ATA_PORT_CLASS_NAME); LMI_DiskDriveATAPort_Set_Caption(&lmi_hdd_ata_port, diff --git a/src/hardware/LMI_DiskDriveATAProtocolEndpointProvider.c b/src/hardware/LMI_DiskDriveATAProtocolEndpointProvider.c index 089f8c6..c7525d4 100644 --- a/src/hardware/LMI_DiskDriveATAProtocolEndpointProvider.c +++ b/src/hardware/LMI_DiskDriveATAProtocolEndpointProvider.c @@ -75,9 +75,9 @@ static CMPIStatus LMI_DiskDriveATAProtocolEndpointEnumInstances( LMI_DiskDriveATAProtocolEndpoint_Init(&lmi_hdd_endpoint, _cb, ns); LMI_DiskDriveATAProtocolEndpoint_Set_SystemCreationClassName( - &lmi_hdd_endpoint, get_system_creation_class_name()); + &lmi_hdd_endpoint, lmi_get_system_creation_class_name()); LMI_DiskDriveATAProtocolEndpoint_Set_SystemName(&lmi_hdd_endpoint, - get_system_name()); + lmi_get_system_name()); LMI_DiskDriveATAProtocolEndpoint_Set_CreationClassName(&lmi_hdd_endpoint, LMI_ORGID "_" DISK_DRIVE_ATA_PROTO_ENDPOINT_CLASS_NAME); LMI_DiskDriveATAProtocolEndpoint_Set_Caption(&lmi_hdd_endpoint, diff --git a/src/hardware/LMI_DiskDriveDeviceSAPImplementationProvider.c b/src/hardware/LMI_DiskDriveDeviceSAPImplementationProvider.c index ab4ee90..5b2c186 100644 --- a/src/hardware/LMI_DiskDriveDeviceSAPImplementationProvider.c +++ b/src/hardware/LMI_DiskDriveDeviceSAPImplementationProvider.c @@ -82,9 +82,9 @@ static CMPIStatus LMI_DiskDriveDeviceSAPImplementationEnumInstances( LMI_DiskDriveATAPortRef_Init(&lmi_hdd_ata_port, _cb, ns); LMI_DiskDriveATAPortRef_Set_SystemCreationClassName(&lmi_hdd_ata_port, - get_system_creation_class_name()); + lmi_get_system_creation_class_name()); LMI_DiskDriveATAPortRef_Set_SystemName(&lmi_hdd_ata_port, - get_system_name()); + lmi_get_system_name()); LMI_DiskDriveATAPortRef_Set_CreationClassName(&lmi_hdd_ata_port, LMI_ORGID "_" DISK_DRIVE_ATA_PORT_CLASS_NAME); LMI_DiskDriveATAPortRef_Set_DeviceID(&lmi_hdd_ata_port, name); @@ -95,9 +95,9 @@ static CMPIStatus LMI_DiskDriveDeviceSAPImplementationEnumInstances( LMI_DiskDriveATAProtocolEndpointRef_Init(&lmi_hdd_ata_endp, _cb, ns); LMI_DiskDriveATAProtocolEndpointRef_Set_SystemCreationClassName( - &lmi_hdd_ata_endp, get_system_creation_class_name()); + &lmi_hdd_ata_endp, lmi_get_system_creation_class_name()); LMI_DiskDriveATAProtocolEndpointRef_Set_SystemName(&lmi_hdd_ata_endp, - get_system_name()); + lmi_get_system_name()); LMI_DiskDriveATAProtocolEndpointRef_Set_CreationClassName(&lmi_hdd_ata_endp, LMI_ORGID "_" DISK_DRIVE_ATA_PROTO_ENDPOINT_CLASS_NAME); LMI_DiskDriveATAProtocolEndpointRef_Set_Name(&lmi_hdd_ata_endp, name); diff --git a/src/hardware/LMI_DiskDriveElementSoftwareIdentityProvider.c b/src/hardware/LMI_DiskDriveElementSoftwareIdentityProvider.c index e07e2ed..cf599be 100644 --- a/src/hardware/LMI_DiskDriveElementSoftwareIdentityProvider.c +++ b/src/hardware/LMI_DiskDriveElementSoftwareIdentityProvider.c @@ -78,8 +78,8 @@ static CMPIStatus LMI_DiskDriveElementSoftwareIdentityEnumInstances( LMI_DiskDriveRef_Init(&lmi_hdd, _cb, ns); LMI_DiskDriveRef_Set_SystemCreationClassName(&lmi_hdd, - get_system_creation_class_name()); - LMI_DiskDriveRef_Set_SystemName(&lmi_hdd, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_DiskDriveRef_Set_SystemName(&lmi_hdd, lmi_get_system_name()); LMI_DiskDriveRef_Set_CreationClassName(&lmi_hdd, LMI_ORGID "_" DISK_DRIVE_CLASS_NAME); LMI_DiskDriveRef_Set_DeviceID(&lmi_hdd, lsblk_hdds[i].name); diff --git a/src/hardware/LMI_DiskDriveProvider.c b/src/hardware/LMI_DiskDriveProvider.c index 5a28a0a..21e5b18 100644 --- a/src/hardware/LMI_DiskDriveProvider.c +++ b/src/hardware/LMI_DiskDriveProvider.c @@ -95,8 +95,8 @@ static CMPIStatus LMI_DiskDriveEnumInstances( LMI_DiskDrive_Init(&lmi_hdd, _cb, ns); LMI_DiskDrive_Set_SystemCreationClassName(&lmi_hdd, - get_system_creation_class_name()); - LMI_DiskDrive_Set_SystemName(&lmi_hdd, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_DiskDrive_Set_SystemName(&lmi_hdd, lmi_get_system_name()); LMI_DiskDrive_Set_CreationClassName(&lmi_hdd, LMI_ORGID "_" DISK_DRIVE_CLASS_NAME); LMI_DiskDrive_Set_Caption(&lmi_hdd, "Disk Drive"); diff --git a/src/hardware/LMI_DiskDriveRealizesProvider.c b/src/hardware/LMI_DiskDriveRealizesProvider.c index 2756dec..5d184e9 100644 --- a/src/hardware/LMI_DiskDriveRealizesProvider.c +++ b/src/hardware/LMI_DiskDriveRealizesProvider.c @@ -77,8 +77,8 @@ static CMPIStatus LMI_DiskDriveRealizesEnumInstances( LMI_DiskDriveRef_Init(&lmi_hdd, _cb, ns); LMI_DiskDriveRef_Set_SystemCreationClassName(&lmi_hdd, - get_system_creation_class_name()); - LMI_DiskDriveRef_Set_SystemName(&lmi_hdd, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_DiskDriveRef_Set_SystemName(&lmi_hdd, lmi_get_system_name()); LMI_DiskDriveRef_Set_CreationClassName(&lmi_hdd, LMI_ORGID "_" DISK_DRIVE_CLASS_NAME); LMI_DiskDriveRef_Set_DeviceID(&lmi_hdd, lsblk_hdds[i].name); diff --git a/src/hardware/LMI_DiskDriveSAPAvailableForElementProvider.c b/src/hardware/LMI_DiskDriveSAPAvailableForElementProvider.c index 51b5f44..be68c87 100644 --- a/src/hardware/LMI_DiskDriveSAPAvailableForElementProvider.c +++ b/src/hardware/LMI_DiskDriveSAPAvailableForElementProvider.c @@ -78,8 +78,8 @@ static CMPIStatus LMI_DiskDriveSAPAvailableForElementEnumInstances( LMI_DiskDriveRef_Init(&lmi_hdd, _cb, ns); LMI_DiskDriveRef_Set_SystemCreationClassName(&lmi_hdd, - get_system_creation_class_name()); - LMI_DiskDriveRef_Set_SystemName(&lmi_hdd, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_DiskDriveRef_Set_SystemName(&lmi_hdd, lmi_get_system_name()); LMI_DiskDriveRef_Set_CreationClassName(&lmi_hdd, LMI_ORGID "_" DISK_DRIVE_CLASS_NAME); LMI_DiskDriveRef_Set_DeviceID(&lmi_hdd, lsblk_hdds[i].name); @@ -90,9 +90,9 @@ static CMPIStatus LMI_DiskDriveSAPAvailableForElementEnumInstances( LMI_DiskDriveATAProtocolEndpointRef_Init(&lmi_hdd_ata_endp, _cb, ns); LMI_DiskDriveATAProtocolEndpointRef_Set_SystemCreationClassName( - &lmi_hdd_ata_endp, get_system_creation_class_name()); + &lmi_hdd_ata_endp, lmi_get_system_creation_class_name()); LMI_DiskDriveATAProtocolEndpointRef_Set_SystemName(&lmi_hdd_ata_endp, - get_system_name()); + lmi_get_system_name()); LMI_DiskDriveATAProtocolEndpointRef_Set_CreationClassName(&lmi_hdd_ata_endp, LMI_ORGID "_" DISK_DRIVE_ATA_PROTO_ENDPOINT_CLASS_NAME); LMI_DiskDriveATAProtocolEndpointRef_Set_Name(&lmi_hdd_ata_endp, name); diff --git a/src/hardware/LMI_DiskDriveSystemDeviceProvider.c b/src/hardware/LMI_DiskDriveSystemDeviceProvider.c index 87fc99d..fd27b91 100644 --- a/src/hardware/LMI_DiskDriveSystemDeviceProvider.c +++ b/src/hardware/LMI_DiskDriveSystemDeviceProvider.c @@ -76,8 +76,8 @@ static CMPIStatus LMI_DiskDriveSystemDeviceEnumInstances( LMI_DiskDriveRef_Init(&lmi_hdd, _cb, ns); LMI_DiskDriveRef_Set_SystemCreationClassName(&lmi_hdd, - get_system_creation_class_name()); - LMI_DiskDriveRef_Set_SystemName(&lmi_hdd, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_DiskDriveRef_Set_SystemName(&lmi_hdd, lmi_get_system_name()); LMI_DiskDriveRef_Set_CreationClassName(&lmi_hdd, LMI_ORGID "_" DISK_DRIVE_CLASS_NAME); LMI_DiskDriveRef_Set_DeviceID(&lmi_hdd, lsblk_hdds[i].name); diff --git a/src/hardware/LMI_MemoryProvider.c b/src/hardware/LMI_MemoryProvider.c index 4626bea..bea9bf2 100644 --- a/src/hardware/LMI_MemoryProvider.c +++ b/src/hardware/LMI_MemoryProvider.c @@ -82,8 +82,8 @@ static CMPIStatus LMI_MemoryEnumInstances( LMI_Memory_Init(&lmi_mem, _cb, ns); LMI_Memory_Set_SystemCreationClassName(&lmi_mem, - get_system_creation_class_name()); - LMI_Memory_Set_SystemName(&lmi_mem, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_Memory_Set_SystemName(&lmi_mem, lmi_get_system_name()); LMI_Memory_Set_CreationClassName(&lmi_mem, LMI_ORGID "_" MEM_CLASS_NAME); LMI_Memory_Set_DeviceID(&lmi_mem, "0"); diff --git a/src/hardware/LMI_MemorySystemDeviceProvider.c b/src/hardware/LMI_MemorySystemDeviceProvider.c index 0c3c7c5..0f79ab7 100644 --- a/src/hardware/LMI_MemorySystemDeviceProvider.c +++ b/src/hardware/LMI_MemorySystemDeviceProvider.c @@ -62,8 +62,8 @@ static CMPIStatus LMI_MemorySystemDeviceEnumInstances( LMI_MemoryRef_Init(&lmi_mem, _cb, ns); LMI_MemoryRef_Set_SystemCreationClassName(&lmi_mem, - get_system_creation_class_name()); - LMI_MemoryRef_Set_SystemName(&lmi_mem, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_MemoryRef_Set_SystemName(&lmi_mem, lmi_get_system_name()); LMI_MemoryRef_Set_CreationClassName(&lmi_mem, LMI_ORGID "_" MEM_CLASS_NAME); LMI_MemoryRef_Set_DeviceID(&lmi_mem, "0"); diff --git a/src/hardware/LMI_PCIBridgeProvider.c b/src/hardware/LMI_PCIBridgeProvider.c index ee8aa50..9863186 100644 --- a/src/hardware/LMI_PCIBridgeProvider.c +++ b/src/hardware/LMI_PCIBridgeProvider.c @@ -135,8 +135,8 @@ static CMPIStatus LMI_PCIBridgeEnumInstances( LMI_PCIBridge_Init(&lmi_dev, _cb, ns); LMI_PCIBridge_Set_SystemCreationClassName(&lmi_dev, - get_system_creation_class_name()); - LMI_PCIBridge_Set_SystemName(&lmi_dev, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_PCIBridge_Set_SystemName(&lmi_dev, lmi_get_system_name()); LMI_PCIBridge_Set_CreationClassName(&lmi_dev, LMI_ORGID "_" PCI_BRIDGE_CLASS_NAME); LMI_PCIBridge_Set_Caption(&lmi_dev, diff --git a/src/hardware/LMI_PCIBridgeSystemDeviceProvider.c b/src/hardware/LMI_PCIBridgeSystemDeviceProvider.c index c413d1f..6618d08 100644 --- a/src/hardware/LMI_PCIBridgeSystemDeviceProvider.c +++ b/src/hardware/LMI_PCIBridgeSystemDeviceProvider.c @@ -84,8 +84,8 @@ static CMPIStatus LMI_PCIBridgeSystemDeviceEnumInstances( LMI_PCIBridgeRef_Init(&lmi_dev, _cb, ns); LMI_PCIBridgeRef_Set_SystemCreationClassName(&lmi_dev, - get_system_creation_class_name()); - LMI_PCIBridgeRef_Set_SystemName(&lmi_dev, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_PCIBridgeRef_Set_SystemName(&lmi_dev, lmi_get_system_name()); LMI_PCIBridgeRef_Set_CreationClassName(&lmi_dev, LMI_ORGID "_" PCI_BRIDGE_CLASS_NAME); LMI_PCIBridgeRef_Set_DeviceID(&lmi_dev, device_id_str); diff --git a/src/hardware/LMI_PCIDeviceProvider.c b/src/hardware/LMI_PCIDeviceProvider.c index e2d0e55..edb1528 100644 --- a/src/hardware/LMI_PCIDeviceProvider.c +++ b/src/hardware/LMI_PCIDeviceProvider.c @@ -115,8 +115,8 @@ static CMPIStatus LMI_PCIDeviceEnumInstances( LMI_PCIDevice_Init(&lmi_dev, _cb, ns); LMI_PCIDevice_Set_SystemCreationClassName(&lmi_dev, - get_system_creation_class_name()); - LMI_PCIDevice_Set_SystemName(&lmi_dev, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_PCIDevice_Set_SystemName(&lmi_dev, lmi_get_system_name()); LMI_PCIDevice_Set_CreationClassName(&lmi_dev, LMI_ORGID "_" PCI_DEVICE_CLASS_NAME); LMI_PCIDevice_Set_Caption(&lmi_dev, diff --git a/src/hardware/LMI_PCIDeviceSystemDeviceProvider.c b/src/hardware/LMI_PCIDeviceSystemDeviceProvider.c index 7231c08..84279c8 100644 --- a/src/hardware/LMI_PCIDeviceSystemDeviceProvider.c +++ b/src/hardware/LMI_PCIDeviceSystemDeviceProvider.c @@ -84,8 +84,8 @@ static CMPIStatus LMI_PCIDeviceSystemDeviceEnumInstances( LMI_PCIDeviceRef_Init(&lmi_dev, _cb, ns); LMI_PCIDeviceRef_Set_SystemCreationClassName(&lmi_dev, - get_system_creation_class_name()); - LMI_PCIDeviceRef_Set_SystemName(&lmi_dev, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_PCIDeviceRef_Set_SystemName(&lmi_dev, lmi_get_system_name()); LMI_PCIDeviceRef_Set_CreationClassName(&lmi_dev, LMI_ORGID "_" PCI_DEVICE_CLASS_NAME); LMI_PCIDeviceRef_Set_DeviceID(&lmi_dev, device_id_str); diff --git a/src/hardware/LMI_PhysicalBatteryRealizesProvider.c b/src/hardware/LMI_PhysicalBatteryRealizesProvider.c index 5cc6afb..a9d1f16 100644 --- a/src/hardware/LMI_PhysicalBatteryRealizesProvider.c +++ b/src/hardware/LMI_PhysicalBatteryRealizesProvider.c @@ -72,8 +72,8 @@ static CMPIStatus LMI_PhysicalBatteryRealizesEnumInstances( LMI_BatteryRef_Init(&lmi_batt, _cb, ns); LMI_BatteryRef_Set_SystemCreationClassName(&lmi_batt, - get_system_creation_class_name()); - LMI_BatteryRef_Set_SystemName(&lmi_batt, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_BatteryRef_Set_SystemName(&lmi_batt, lmi_get_system_name()); LMI_BatteryRef_Set_CreationClassName(&lmi_batt, LMI_ORGID "_" BATTERY_CLASS_NAME); LMI_BatteryRef_Set_DeviceID(&lmi_batt, dmi_batt[i].name); diff --git a/src/hardware/LMI_PhysicalMemoryRealizesProvider.c b/src/hardware/LMI_PhysicalMemoryRealizesProvider.c index 9128450..4f44db7 100644 --- a/src/hardware/LMI_PhysicalMemoryRealizesProvider.c +++ b/src/hardware/LMI_PhysicalMemoryRealizesProvider.c @@ -68,8 +68,8 @@ static CMPIStatus LMI_PhysicalMemoryRealizesEnumInstances( LMI_MemoryRef_Init(&lmi_mem, _cb, ns); LMI_MemoryRef_Set_SystemCreationClassName(&lmi_mem, - get_system_creation_class_name()); - LMI_MemoryRef_Set_SystemName(&lmi_mem, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_MemoryRef_Set_SystemName(&lmi_mem, lmi_get_system_name()); LMI_MemoryRef_Set_CreationClassName(&lmi_mem, LMI_ORGID "_" MEM_CLASS_NAME); LMI_MemoryRef_Set_DeviceID(&lmi_mem, "0"); diff --git a/src/hardware/LMI_PointingDeviceProvider.c b/src/hardware/LMI_PointingDeviceProvider.c index 1b169df..1999a00 100644 --- a/src/hardware/LMI_PointingDeviceProvider.c +++ b/src/hardware/LMI_PointingDeviceProvider.c @@ -72,8 +72,8 @@ static CMPIStatus LMI_PointingDeviceEnumInstances( LMI_PointingDevice_Init(&lmi_dev, _cb, ns); LMI_PointingDevice_Set_SystemCreationClassName(&lmi_dev, - get_system_creation_class_name()); - LMI_PointingDevice_Set_SystemName(&lmi_dev, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_PointingDevice_Set_SystemName(&lmi_dev, lmi_get_system_name()); LMI_PointingDevice_Set_CreationClassName(&lmi_dev, LMI_ORGID "_" POINTING_DEVICE_CLASS_NAME); LMI_PointingDevice_Set_Caption(&lmi_dev, "Pointing Device"); diff --git a/src/hardware/LMI_ProcessorCacheMemoryProvider.c b/src/hardware/LMI_ProcessorCacheMemoryProvider.c index 2365856..92c3a91 100644 --- a/src/hardware/LMI_ProcessorCacheMemoryProvider.c +++ b/src/hardware/LMI_ProcessorCacheMemoryProvider.c @@ -88,9 +88,9 @@ static CMPIStatus LMI_ProcessorCacheMemoryEnumInstances( LMI_ProcessorCacheMemory_Init(&lmi_cpu_cache, _cb, ns); LMI_ProcessorCacheMemory_Set_SystemCreationClassName(&lmi_cpu_cache, - get_system_creation_class_name()); + lmi_get_system_creation_class_name()); LMI_ProcessorCacheMemory_Set_SystemName(&lmi_cpu_cache, - get_system_name()); + lmi_get_system_name()); LMI_ProcessorCacheMemory_Set_CreationClassName(&lmi_cpu_cache, LMI_ORGID "_" CPU_CACHE_CLASS_NAME); diff --git a/src/hardware/LMI_ProcessorChipRealizesProvider.c b/src/hardware/LMI_ProcessorChipRealizesProvider.c index e1b0bed..dc50b8d 100644 --- a/src/hardware/LMI_ProcessorChipRealizesProvider.c +++ b/src/hardware/LMI_ProcessorChipRealizesProvider.c @@ -72,8 +72,8 @@ static CMPIStatus LMI_ProcessorChipRealizesEnumInstances( LMI_ProcessorRef_Init(&lmi_cpu, _cb, ns); LMI_ProcessorRef_Set_SystemCreationClassName(&lmi_cpu, - get_system_creation_class_name()); - LMI_ProcessorRef_Set_SystemName(&lmi_cpu, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_ProcessorRef_Set_SystemName(&lmi_cpu, lmi_get_system_name()); LMI_ProcessorRef_Set_CreationClassName(&lmi_cpu, LMI_ORGID "_" CPU_CLASS_NAME); LMI_ProcessorRef_Set_DeviceID(&lmi_cpu, dmi_cpus[i].id); diff --git a/src/hardware/LMI_ProcessorElementCapabilitiesProvider.c b/src/hardware/LMI_ProcessorElementCapabilitiesProvider.c index 5ec6a96..aa8ed68 100644 --- a/src/hardware/LMI_ProcessorElementCapabilitiesProvider.c +++ b/src/hardware/LMI_ProcessorElementCapabilitiesProvider.c @@ -91,8 +91,8 @@ static CMPIStatus LMI_ProcessorElementCapabilitiesEnumInstances( LMI_ProcessorRef_Init(&lmi_cpu, _cb, ns); LMI_ProcessorRef_Set_SystemCreationClassName(&lmi_cpu, - get_system_creation_class_name()); - LMI_ProcessorRef_Set_SystemName(&lmi_cpu, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_ProcessorRef_Set_SystemName(&lmi_cpu, lmi_get_system_name()); LMI_ProcessorRef_Set_CreationClassName(&lmi_cpu, LMI_ORGID "_" CPU_CLASS_NAME); diff --git a/src/hardware/LMI_ProcessorProvider.c b/src/hardware/LMI_ProcessorProvider.c index 67d1987..a2a0dc7 100644 --- a/src/hardware/LMI_ProcessorProvider.c +++ b/src/hardware/LMI_ProcessorProvider.c @@ -125,8 +125,8 @@ static CMPIStatus LMI_ProcessorEnumInstances( LMI_Processor_Init(&lmi_cpu, _cb, ns); LMI_Processor_Set_SystemCreationClassName(&lmi_cpu, - get_system_creation_class_name()); - LMI_Processor_Set_SystemName(&lmi_cpu, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_Processor_Set_SystemName(&lmi_cpu, lmi_get_system_name()); LMI_Processor_Set_CreationClassName(&lmi_cpu, LMI_ORGID "_" CPU_CLASS_NAME); LMI_Processor_Set_Caption(&lmi_cpu, CPU_CLASS_NAME); LMI_Processor_Set_Description(&lmi_cpu, diff --git a/src/hardware/LMI_ProcessorSystemDeviceProvider.c b/src/hardware/LMI_ProcessorSystemDeviceProvider.c index e8ac492..8bf8e3d 100644 --- a/src/hardware/LMI_ProcessorSystemDeviceProvider.c +++ b/src/hardware/LMI_ProcessorSystemDeviceProvider.c @@ -71,8 +71,8 @@ static CMPIStatus LMI_ProcessorSystemDeviceEnumInstances( LMI_ProcessorRef_Init(&lmi_cpu, _cb, ns); LMI_ProcessorRef_Set_SystemCreationClassName(&lmi_cpu, - get_system_creation_class_name()); - LMI_ProcessorRef_Set_SystemName(&lmi_cpu, get_system_name()); + lmi_get_system_creation_class_name()); + LMI_ProcessorRef_Set_SystemName(&lmi_cpu, lmi_get_system_name()); LMI_ProcessorRef_Set_CreationClassName(&lmi_cpu, LMI_ORGID "_" CPU_CLASS_NAME); LMI_ProcessorRef_Set_DeviceID(&lmi_cpu, dmi_cpus[i].id); diff --git a/src/libs/libopenlmi/openlmi.c b/src/libs/libopenlmi/openlmi.c index 6257520..1259fbc 100644 --- a/src/libs/libopenlmi/openlmi.c +++ b/src/libs/libopenlmi/openlmi.c @@ -388,46 +388,44 @@ void _lmi_debug(int level, const char *file, int line, const char *format, ...) -CMPIStatus lmi_check_required( - const CMPIBroker *b, +CMPIStatus lmi_check_required_properties( + const CMPIBroker *cb, const CMPIContext *ctx, - const CMPIObjectPath *o) + const CMPIObjectPath *o, + const char *csccn_prop_name, + const char *csn_prop_name) { CMPIStatus st; CMPIData data; - const char *prop; /* check computer system creation class name */ - data = CMGetKey(o, "CSCreationClassName", &st); - lmi_check_status(st); - + data = CMGetKey(o, csccn_prop_name, &st); + lmi_return_if_status_not_ok(st); if (CMIsNullValue(data)) { - CMReturnWithChars(b, CMPI_RC_ERR_FAILED, "CSCreationClassName is empty"); + lmi_return_with_chars(cb, CMPI_RC_ERR_FAILED, "%s is empty", csccn_prop_name); } - prop = lmi_get_string_property_from_objectpath(o, "CSCreationClassName"); - if (strcmp(prop, lmi_get_system_creation_class_name()) != 0) { - CMReturnWithChars(b, CMPI_RC_ERR_FAILED, "Wrong CSCreationClassName"); + if (strcmp(KChars(data.value.string), lmi_get_system_creation_class_name()) != 0) { + lmi_return_with_chars(cb, CMPI_RC_ERR_FAILED, "Wrong %s", csccn_prop_name); } /* check fqdn */ - data = CMGetKey(o, "CSName", &st); - lmi_check_status(st); + data = CMGetKey(o, csn_prop_name, &st); + lmi_return_if_status_not_ok(st); if (CMIsNullValue(data)) { - CMReturnWithChars(b, CMPI_RC_ERR_FAILED, "CSName is empty"); + lmi_return_with_chars(cb, CMPI_RC_ERR_FAILED, "%s is empty", csn_prop_name); } - prop = lmi_get_string_property_from_objectpath(o, "CSName"); - if (strcmp(prop, lmi_get_system_name()) != 0) { - CMReturnWithChars(b, CMPI_RC_ERR_FAILED, "Wrong CSName"); + if (strcmp(KChars(data.value.string), lmi_get_system_name()) != 0) { + lmi_return_with_chars(cb, CMPI_RC_ERR_FAILED, "Wrong %s", csn_prop_name); } CMReturn(CMPI_RC_OK); } -CMPIStatus lmi_check_assoc_class( +CMPIStatus lmi_class_path_is_a( const CMPIBroker *cb, const char *namespace, - const char *assocClass, - const char *class) + const char *class, + const char *class_type) { CMPIObjectPath *o; CMPIStatus st = {.rc = CMPI_RC_OK}; @@ -440,9 +438,9 @@ CMPIStatus lmi_check_assoc_class( CMRelease(o); return st; } - if (assocClass && !CMClassPathIsA(cb, o, assocClass, &st)) { - CMRelease(o); + if (class_type && !CMClassPathIsA(cb, o, class_type, &st)) { st.rc = LMI_RC_ERR_CLASS_CHECK_FAILED; + CMRelease(o); return st; } CMRelease(o); @@ -462,3 +460,9 @@ const char *lmi_get_string_property_from_instance(const CMPIInstance *i, const c d = CMGetProperty(i, prop, NULL); return KChars(d.value.string); } + +/* vi: set et: */ +/* Local Variables: */ +/* indent-tabs-mode: nil */ +/* c-basic-offset: 4 */ +/* End: */ diff --git a/src/libs/libopenlmi/openlmi.h b/src/libs/libopenlmi/openlmi.h index 7f151cd..a35e01e 100644 --- a/src/libs/libopenlmi/openlmi.h +++ b/src/libs/libopenlmi/openlmi.h @@ -182,8 +182,7 @@ void lmi_set_log_level(int level); * @retval true if succeeds * @retval false if addition fails */ -/* TODO: Rename. Looks like a class. */ -#define LMI_ReturnInstance(cr, w) KOkay(__KReturnInstance((cr), &(w).__base)) +#define lmi_return_instance(cr, w) KOkay(__KReturnInstance((cr), &(w).__base)) enum { _LMI_DEBUG_NONE=0, _LMI_DEBUG_ERROR, _LMI_DEBUG_WARN, @@ -196,28 +195,32 @@ void _lmi_debug(int level, const char *file, int line, const char *format, ...); #define lmi_info(...) _lmi_debug(_LMI_DEBUG_INFO, __FILE__, __LINE__, __VA_ARGS__) #define lmi_warn(...) _lmi_debug(_LMI_DEBUG_WARN, __FILE__, __LINE__, __VA_ARGS__) #define lmi_error(...) _lmi_debug(_LMI_DEBUG_ERROR, __FILE__, __LINE__, __VA_ARGS__) -#define lmi_dump_objectpath(o, lvl) \ +#define lmi_dump_objectpath(o, lvl) \ lmi_##lvl("OP: %s", CMGetCharsPtr((o)->ft->toString(o, NULL), NULL)) -/* Shortcuts for functions and macros from openlmicommon library. */ -#define get_system_creation_class_name lmi_get_system_creation_class_name -#define get_system_name lmi_get_system_name + +#define lmi_return_with_chars(b, code, ...) \ + do { \ + char errmsg[BUFLEN]; \ + snprintf(errmsg, BUFLEN - 1, __VA_ARGS__); \ + CMReturnWithChars(b, code, errmsg); \ + } while (0) /* Status checking helpers. Beware of the returns! */ -#define lmi_check_status(st) \ +#define lmi_return_if_status_not_ok(st) \ do { \ - if (st.rc != CMPI_RC_OK) { \ - return st; \ + if ((st).rc != CMPI_RC_OK) { \ + return (st); \ } \ } while (0) -#define lmi_check_class_check_status(st) \ +#define lmi_return_if_class_check_not_ok(st) \ do { \ - if (st.rc == LMI_RC_ERR_CLASS_CHECK_FAILED) { \ + if ((st).rc == LMI_RC_ERR_CLASS_CHECK_FAILED) { \ CMReturn(CMPI_RC_OK); \ } \ - lmi_check_status(st); \ + lmi_return_if_status_not_ok(st); \ } while (0) #define lmi_return_with_status(b, st, code, msg) \ @@ -227,10 +230,40 @@ void _lmi_debug(int level, const char *file, int line, const char *format, ...); } while(0) -CMPIStatus lmi_check_required(const CMPIBroker *, const CMPIContext *, const CMPIObjectPath *); -CMPIStatus lmi_check_assoc_class(const CMPIBroker *, const char *, const char *, const char *); +/** + * Check required properties and their values. currently, only computer system + * creation class name and computer system name are checked. + * + * @param cb CMPIBroker + * @param ctx CMPIContext + * @param o Objectpath to be checked + * @param csccn_prop_name Computer system creation class name property name + * @param csn_prop_name Computer system name property name + */ +CMPIStatus lmi_check_required_properties(const CMPIBroker *cb, const CMPIContext *ctx, + const CMPIObjectPath *o, + const char *csccn_prop_name, + const char *csn_prop_name); + +/** + * Determine whether a CIM class is of <class_type> or any of <class_type> + * subclasses. + * + * @param cb CMPIBroker + * @param namespace CIMOM namespace + * @param class Class to be checked + * @param class_type Class to be checked against + */ +CMPIStatus lmi_class_path_is_a(const CMPIBroker *cb, const char *namespace, + const char *class, const char *class_type); -const char *lmi_get_string_property_from_objectpath(const CMPIObjectPath *, const char *); -const char *lmi_get_string_property_from_instance(const CMPIInstance *, const char *); +const char *lmi_get_string_property_from_objectpath(const CMPIObjectPath *o, const char *prop); +const char *lmi_get_string_property_from_instance(const CMPIInstance *i, const char *prop); #endif /* OPENLMI_H */ + +/* vi: set et: */ +/* Local Variables: */ +/* indent-tabs-mode: nil */ +/* c-basic-offset: 4 */ +/* End: */ diff --git a/src/logicalfile/LMI_DataFileProvider.c b/src/logicalfile/LMI_DataFileProvider.c index cef3219..c91da1e 100644 --- a/src/logicalfile/LMI_DataFileProvider.c +++ b/src/logicalfile/LMI_DataFileProvider.c @@ -65,12 +65,12 @@ static CMPIStatus LMI_DataFileGetInstance( CMPIStatus st = {.rc = CMPI_RC_OK}; logicalfile_t logicalfile; - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); LMI_DataFile_InitFromObjectPath(&logicalfile.lf.datafile, _cb, cop); st = stat_logicalfile_and_fill(_cb, &logicalfile, S_IFREG, "Not a regular file: %s"); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); KReturnInstance(cr, logicalfile.lf.datafile); return st; diff --git a/src/logicalfile/LMI_DirectoryContainsFileProvider.c b/src/logicalfile/LMI_DirectoryContainsFileProvider.c index bcf6d14..8511bfa 100644 --- a/src/logicalfile/LMI_DirectoryContainsFileProvider.c +++ b/src/logicalfile/LMI_DirectoryContainsFileProvider.c @@ -51,17 +51,17 @@ static CMPIStatus logicalfile_objectpath_from_path( CMReturnWithChars(_cb, CMPI_RC_ERR_NOT_FOUND, err); } else { get_class_from_stat(&sb, fileclass); - st = lmi_check_assoc_class(_cb, namespace, resultClass, fileclass); + st = lmi_class_path_is_a(_cb, namespace, fileclass, resultClass); if (st.rc == LMI_RC_ERR_CLASS_CHECK_FAILED) { st.rc = CMPI_RC_OK; *o = NULL; return st; } /* check status again for other possible errors */ - lmi_check_status(st); + lmi_return_if_status_not_ok(st); st = get_fsinfo_from_stat(_cb, &sb, abspath, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); } CIM_LogicalFileRef cim_lfr; @@ -107,7 +107,7 @@ static CMPIStatus dir_file_objectpaths( dirname = g_path_get_dirname(path); st = logicalfile_objectpath_from_path(dirname, resultClass, namespace, &o); g_free(dirname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); if (o) { ops[i++] = o; } @@ -160,8 +160,8 @@ static CMPIStatus associators( int group = -1; int rgroup = -1; - st = lmi_check_assoc_class(_cb, ns, assocClass, LMI_DirectoryContainsFile_ClassName); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, LMI_DirectoryContainsFile_ClassName, assocClass); + lmi_return_if_class_check_not_ok(st); /* role && resultRole checks */ if (role) { if (strcmp(role, LMI_GROUP_COMPONENT) != 0 && strcmp(role, LMI_PART_COMPONENT) != 0) { @@ -189,7 +189,7 @@ static CMPIStatus associators( if (CMClassPathIsA(_cb, cop, LMI_UnixDirectory_ClassName, &st)) { /* got UnixDirectory - GroupComponent */ - st = lmi_check_required(_cb, cc, cop); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); if (st.rc != CMPI_RC_OK) { return st; } @@ -216,7 +216,7 @@ static CMPIStatus associators( } } else if (CMClassPathIsA(_cb, cop, CIM_LogicalFile_ClassName, &st)) { /* got LogicalFile - PartComponent */ - st = lmi_check_required(_cb, cc, cop); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); if (st.rc != CMPI_RC_OK) { return st; } @@ -226,8 +226,8 @@ static CMPIStatus associators( path = lmi_get_string_property_from_objectpath(cop, "Name"); if (!path) CMReturnWithChars(_cb, CMPI_RC_ERR_NOT_FOUND, "Cannot find Name property in provided CIM_logicalFile"); - st = lmi_check_assoc_class(_cb, ns, resultClass, LMI_UnixDirectory_ClassName); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, LMI_UnixDirectory_ClassName, resultClass); + lmi_return_if_class_check_not_ok(st); CIM_DirectoryRef lmi_dr; CIM_DirectoryRef_Init(&lmi_dr, _cb, ns); @@ -236,7 +236,7 @@ static CMPIStatus associators( char *fsclassname = NULL; st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); gchar *dirname = g_path_get_dirname(path); fill_logicalfile(CIM_DirectoryRef, &lmi_dr, dirname, fsclassname, fsname, LMI_UnixDirectory_ClassName); @@ -283,8 +283,8 @@ static CMPIStatus references( CMPIInstance *ci; int group = -1; - st = lmi_check_assoc_class(_cb, ns, assocClass, LMI_DirectoryContainsFile_ClassName); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, LMI_DirectoryContainsFile_ClassName, assocClass); + lmi_return_if_class_check_not_ok(st); if (role) { if (strcmp(role, LMI_GROUP_COMPONENT) != 0 && strcmp(role, LMI_PART_COMPONENT) != 0) { CMReturn(CMPI_RC_OK); @@ -301,13 +301,13 @@ static CMPIStatus references( if (CMClassPathIsA(_cb, cop, LMI_UnixDirectory_ClassName, &st)) { - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); path = lmi_get_string_property_from_objectpath(cop, "Name"); if (!path) CMReturnWithChars(_cb, CMPI_RC_ERR_NOT_FOUND, "Cannot find Name property in provided LMI_UnixDirectory"); st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); /* got GroupComponent - DirectoryRef */ fill_logicalfile(CIM_DirectoryRef, &lmi_dr, path, fsclassname, fsname, LMI_UnixDirectory_ClassName); o = CIM_DirectoryRef_ToObjectPath(&lmi_dr, &st); @@ -318,7 +318,7 @@ static CMPIStatus references( CMPIObjectPath *refs[MAX_REFS]; unsigned int count = 0; st = dir_file_objectpaths(cc, cr, NULL, group, -1, properties, ns, path, refs, &count); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); if (count > MAX_REFS) { CMReturnWithChars(_cb, CMPI_RC_ERR_NOT_FOUND, "Too many files in a single directory..."); } @@ -335,14 +335,14 @@ static CMPIStatus references( } } } else if (CMClassPathIsA(_cb, cop, CIM_LogicalFile_ClassName, &st)) { - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); path = lmi_get_string_property_from_objectpath(cop, "Name"); if (!path) CMReturnWithChars(_cb, CMPI_RC_ERR_NOT_FOUND, "Cannot find Name property in provided CIM_LogicalFile"); get_class_from_path(path, ccname); st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); /* got PartComponent - LogicalFileRef */ if (group == 1) { CMReturn(CMPI_RC_OK); diff --git a/src/logicalfile/LMI_FIFOPipeFileProvider.c b/src/logicalfile/LMI_FIFOPipeFileProvider.c index 1330f56..59dc23d 100644 --- a/src/logicalfile/LMI_FIFOPipeFileProvider.c +++ b/src/logicalfile/LMI_FIFOPipeFileProvider.c @@ -65,12 +65,12 @@ static CMPIStatus LMI_FIFOPipeFileGetInstance( CMPIStatus st = {.rc = CMPI_RC_OK}; logicalfile_t logicalfile; - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); LMI_FIFOPipeFile_InitFromObjectPath(&logicalfile.lf.fifopipefile, _cb, cop); st = stat_logicalfile_and_fill(_cb, &logicalfile, S_IFIFO, "No such FIFO: %s"); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); KReturnInstance(cr, logicalfile.lf.fifopipefile); return st; diff --git a/src/logicalfile/LMI_FileIdentityProvider.c b/src/logicalfile/LMI_FileIdentityProvider.c index b1a8599..7811895 100644 --- a/src/logicalfile/LMI_FileIdentityProvider.c +++ b/src/logicalfile/LMI_FileIdentityProvider.c @@ -48,21 +48,21 @@ static CMPIStatus associators( char *fsname = NULL; char *fsclassname = NULL; - st = lmi_check_assoc_class(_cb, ns, assocClass, LMI_FileIdentity_ClassName); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, LMI_FileIdentity_ClassName, assocClass); + lmi_return_if_class_check_not_ok(st); if (CMClassPathIsA(_cb, cop, LMI_UnixFile_ClassName, &st)) { /* got UnixFile - SameElement */ - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); path = lmi_get_string_property_from_objectpath(cop, "LFName"); get_class_from_path(path, fileclass); st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); - st = lmi_check_assoc_class(_cb, ns, resultClass, fileclass); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, fileclass, resultClass); + lmi_return_if_class_check_not_ok(st); if (role && strcmp(role, LMI_SAME_ELEMENT) != 0) { CMReturn(CMPI_RC_OK); } @@ -77,13 +77,13 @@ static CMPIStatus associators( CMSetClassName(o, fileclass); } else if (CMClassPathIsA(_cb, cop, CIM_LogicalFile_ClassName, &st)) { /* got LogicalFile - SystemElement */ - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); path = lmi_get_string_property_from_objectpath(cop, "Name"); - st = lmi_check_assoc_class(_cb, ns, resultClass, LMI_UnixFile_ClassName); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, LMI_UnixFile_ClassName, resultClass); + lmi_return_if_class_check_not_ok(st); if (role && strcmp(role, LMI_SYSTEM_ELEMENT) != 0) { CMReturn(CMPI_RC_OK); } @@ -93,13 +93,13 @@ static CMPIStatus associators( get_class_from_path(path, fileclass); st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); LMI_UnixFile lmi_uf; LMI_UnixFile_Init(&lmi_uf, _cb, ns); LMI_UnixFile_Set_LFName(&lmi_uf, path); - LMI_UnixFile_Set_CSCreationClassName(&lmi_uf, get_system_creation_class_name()); - LMI_UnixFile_Set_CSName(&lmi_uf, get_system_name()); + LMI_UnixFile_Set_CSCreationClassName(&lmi_uf, lmi_get_system_creation_class_name()); + LMI_UnixFile_Set_CSName(&lmi_uf, lmi_get_system_name()); LMI_UnixFile_Set_FSCreationClassName(&lmi_uf, fsclassname); LMI_UnixFile_Set_FSName(&lmi_uf, fsname); LMI_UnixFile_Set_LFCreationClassName(&lmi_uf, fileclass); @@ -138,8 +138,8 @@ static CMPIStatus references( char *fsname = NULL; char *fsclassname = NULL; - st = lmi_check_assoc_class(_cb, ns, assocClass, LMI_FileIdentity_ClassName); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, LMI_FileIdentity_ClassName, assocClass); + lmi_return_if_class_check_not_ok(st); LMI_FileIdentity_Init(&lmi_fi, _cb, ns); @@ -147,7 +147,7 @@ static CMPIStatus references( /* got UnixFile - SameElement */ LMI_FileIdentity_SetObjectPath_SameElement(&lmi_fi, cop); - st = lmi_check_required(_cb, cc, cop); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); if (st.rc != CMPI_RC_OK) { return st; } @@ -155,7 +155,7 @@ static CMPIStatus references( path = lmi_get_string_property_from_objectpath(cop, "LFName"); get_class_from_path(path, fileclass); st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); if (role && strcmp(role, LMI_SAME_ELEMENT) != 0) { CMReturn(CMPI_RC_OK); @@ -173,7 +173,7 @@ static CMPIStatus references( /* got LogicalFile - SystemElement */ LMI_FileIdentity_SetObjectPath_SystemElement(&lmi_fi, cop); - st = lmi_check_required(_cb, cc, cop); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); if (st.rc != CMPI_RC_OK) { return st; } @@ -184,14 +184,14 @@ static CMPIStatus references( path = lmi_get_string_property_from_objectpath(cop, "Name"); get_class_from_path(path, fileclass); st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); /* SameElement */ LMI_UnixFile lmi_uf; LMI_UnixFile_Init(&lmi_uf, _cb, ns); LMI_UnixFile_Set_LFName(&lmi_uf, path); - LMI_UnixFile_Set_CSCreationClassName(&lmi_uf, get_system_creation_class_name()); - LMI_UnixFile_Set_CSName(&lmi_uf, get_system_name()); + LMI_UnixFile_Set_CSCreationClassName(&lmi_uf, lmi_get_system_creation_class_name()); + LMI_UnixFile_Set_CSName(&lmi_uf, lmi_get_system_name()); LMI_UnixFile_Set_FSCreationClassName(&lmi_uf, fsclassname); LMI_UnixFile_Set_FSName(&lmi_uf, fsname); LMI_UnixFile_Set_LFCreationClassName(&lmi_uf, fileclass); diff --git a/src/logicalfile/LMI_RootDirectoryProvider.c b/src/logicalfile/LMI_RootDirectoryProvider.c index 4ada3f5..501638f 100644 --- a/src/logicalfile/LMI_RootDirectoryProvider.c +++ b/src/logicalfile/LMI_RootDirectoryProvider.c @@ -40,22 +40,22 @@ static CMPIStatus associators( CMPIInstance *ci; CMPIStatus st; const char *ns = KNameSpace(cop); - const char *comp_ccname = get_system_creation_class_name(); + const char *comp_ccname = lmi_get_system_creation_class_name(); const char *path = lmi_get_string_property_from_objectpath(cop, "Name"); char *fsname = NULL; char *fsclassname = NULL; const char *systemname = lmi_get_system_creation_class_name(); - st = lmi_check_assoc_class(_cb, ns, assocClass, LMI_RootDirectory_ClassName); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, LMI_RootDirectory_ClassName, assocClass); + lmi_return_if_class_check_not_ok(st); st = get_fsinfo_from_path(_cb, "/", &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); if (CMClassPathIsA(_cb, cop, LMI_UnixDirectory_ClassName, &st)) { /* got LMI_UnixDirectory - PartComponent */ - st = lmi_check_assoc_class(_cb, ns, resultClass, comp_ccname); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, comp_ccname, resultClass); + lmi_return_if_class_check_not_ok(st); if (role && strcmp(role, LMI_PART_COMPONENT) != 0) { CMReturn(CMPI_RC_OK); } @@ -75,8 +75,8 @@ static CMPIStatus associators( } } else if (CMClassPathIsA(_cb, cop, systemname, &st)) { /* got CIM_ComputerSystem - GroupComponent */ - st = lmi_check_assoc_class(_cb, ns, resultClass, LMI_UnixDirectory_ClassName); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, LMI_UnixDirectory_ClassName, resultClass); + lmi_return_if_class_check_not_ok(st); if (role && strcmp(role, LMI_GROUP_COMPONENT) != 0) { CMReturn(CMPI_RC_OK); } @@ -122,13 +122,13 @@ static CMPIStatus references( get_class_from_path(path, ccname); const char *systemname = lmi_get_system_creation_class_name(); - st = lmi_check_assoc_class(_cb, ns, assocClass, LMI_RootDirectory_ClassName); - lmi_check_class_check_status(st); + st = lmi_class_path_is_a(_cb, ns, LMI_RootDirectory_ClassName, assocClass); + lmi_return_if_class_check_not_ok(st); char *fsname = NULL; char *fsclassname = NULL; st = get_fsinfo_from_path(_cb, "/", &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); LMI_RootDirectory_Init(&lmi_rd, _cb, ns); @@ -141,8 +141,8 @@ static CMPIStatus references( if (strcmp(path, "/") != 0) { CMReturn(CMPI_RC_OK); } - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); LMI_RootDirectory_SetObjectPath_PartComponent(&lmi_rd, cop); LMI_RootDirectory_SetObjectPath_GroupComponent(&lmi_rd, @@ -218,7 +218,7 @@ static CMPIStatus LMI_RootDirectoryEnumInstances( LMI_UnixDirectory lmi_ud; LMI_UnixDirectory_Init(&lmi_ud, _cb, ns); st = get_fsinfo_from_path(_cb, "/", &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); fill_logicalfile(LMI_UnixDirectory, &lmi_ud, "/", fsclassname, fsname, LMI_UnixDirectory_ClassName); o = LMI_UnixDirectory_ToObjectPath(&lmi_ud, NULL); LMI_RootDirectory_SetObjectPath_PartComponent(&lmi_rd, o); diff --git a/src/logicalfile/LMI_SymbolicLinkProvider.c b/src/logicalfile/LMI_SymbolicLinkProvider.c index 68a6142..362291a 100644 --- a/src/logicalfile/LMI_SymbolicLinkProvider.c +++ b/src/logicalfile/LMI_SymbolicLinkProvider.c @@ -65,12 +65,12 @@ static CMPIStatus LMI_SymbolicLinkGetInstance( CMPIStatus st = {.rc = CMPI_RC_OK}; logicalfile_t logicalfile; - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); LMI_SymbolicLink_InitFromObjectPath(&logicalfile.lf.symboliclink, _cb, cop); st = stat_logicalfile_and_fill(_cb, &logicalfile, S_IFLNK, "No such symlink: %s"); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); KReturnInstance(cr, logicalfile.lf.symboliclink); return st; @@ -85,9 +85,9 @@ static CMPIStatus LMI_SymbolicLinkCreateInstance( { CMPIStatus st = {.rc = CMPI_RC_OK}; CMPIObjectPath *iop = CMGetObjectPath(ci, &st); - lmi_check_status(st); - st = lmi_check_required(_cb, cc, iop); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); + st = lmi_check_required_properties(_cb, cc, iop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); const char *path = lmi_get_string_property_from_instance(ci, "Name"); const char *target = lmi_get_string_property_from_instance(ci, "TargetFile"); diff --git a/src/logicalfile/LMI_UnixDeviceFileProvider.c b/src/logicalfile/LMI_UnixDeviceFileProvider.c index 3062094..07ac033 100644 --- a/src/logicalfile/LMI_UnixDeviceFileProvider.c +++ b/src/logicalfile/LMI_UnixDeviceFileProvider.c @@ -65,12 +65,12 @@ static CMPIStatus LMI_UnixDeviceFileGetInstance( CMPIStatus st = {.rc = CMPI_RC_OK}; logicalfile_t logicalfile; - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); LMI_UnixDeviceFile_InitFromObjectPath(&logicalfile.lf.unixdevicefile, _cb, cop); st = stat_logicalfile_and_fill(_cb, &logicalfile, S_IFCHR | S_IFBLK, "No such device: %s"); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); KReturnInstance(cr, logicalfile.lf.unixdevicefile); return st; diff --git a/src/logicalfile/LMI_UnixDirectoryProvider.c b/src/logicalfile/LMI_UnixDirectoryProvider.c index 1ca995b..8cb18a5 100644 --- a/src/logicalfile/LMI_UnixDirectoryProvider.c +++ b/src/logicalfile/LMI_UnixDirectoryProvider.c @@ -65,12 +65,12 @@ static CMPIStatus LMI_UnixDirectoryGetInstance( CMPIStatus st = {.rc = CMPI_RC_OK}; logicalfile_t logicalfile; - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); LMI_UnixDirectory_InitFromObjectPath(&logicalfile.lf.unixdirectory, _cb, cop); st = stat_logicalfile_and_fill(_cb, &logicalfile, S_IFDIR, "Not a directory: %s"); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); KReturnInstance(cr, logicalfile.lf.unixdirectory); return st; @@ -85,9 +85,9 @@ static CMPIStatus LMI_UnixDirectoryCreateInstance( { CMPIStatus st; CMPIObjectPath *iop = CMGetObjectPath(ci, &st); - lmi_check_status(st); - st = lmi_check_required(_cb, cc, iop); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); + st = lmi_check_required_properties(_cb, cc, iop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); const char *path = lmi_get_string_property_from_objectpath(iop, "Name"); bool allow = lmi_read_config_boolean("LMI_UnixDirectory", "AllowMkdir"); diff --git a/src/logicalfile/LMI_UnixFileProvider.c b/src/logicalfile/LMI_UnixFileProvider.c index 52e7b9c..0a92751 100644 --- a/src/logicalfile/LMI_UnixFileProvider.c +++ b/src/logicalfile/LMI_UnixFileProvider.c @@ -122,7 +122,7 @@ static CMPIStatus LMI_UnixFileGetInstance( char *fsname; char *fsclassname; - st = lmi_check_required(_cb, cc, cop); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); if (st.rc != CMPI_RC_OK) { return st; } @@ -140,7 +140,7 @@ static CMPIStatus LMI_UnixFileGetInstance( fsname = (char *) KChars(lmi_file.FSName.value); fsclassname = (char *) KChars(lmi_file.FSCreationClassName.value); st = get_fsinfo_from_stat(_cb, &sb, path, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); LMI_UnixFile_Set_FSCreationClassName(&lmi_file, fsclassname); LMI_UnixFile_Set_FSName(&lmi_file, fsname); get_class_from_stat(&sb, aux); diff --git a/src/logicalfile/LMI_UnixSocketProvider.c b/src/logicalfile/LMI_UnixSocketProvider.c index d19753c..24a1225 100644 --- a/src/logicalfile/LMI_UnixSocketProvider.c +++ b/src/logicalfile/LMI_UnixSocketProvider.c @@ -65,12 +65,12 @@ static CMPIStatus LMI_UnixSocketGetInstance( CMPIStatus st = {.rc = CMPI_RC_OK}; logicalfile_t logicalfile; - st = lmi_check_required(_cb, cc, cop); - lmi_check_status(st); + st = lmi_check_required_properties(_cb, cc, cop, "CSCreationClassName", "CSName"); + lmi_return_if_status_not_ok(st); LMI_UnixSocket_InitFromObjectPath(&logicalfile.lf.unixsocket, _cb, cop); st = stat_logicalfile_and_fill(_cb, &logicalfile, S_IFSOCK, "No such socket: %s"); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); KReturnInstance(cr, logicalfile.lf.unixsocket); return st; diff --git a/src/logicalfile/file.c b/src/logicalfile/file.c index 03c99da..28ef7fe 100644 --- a/src/logicalfile/file.c +++ b/src/logicalfile/file.c @@ -141,7 +141,7 @@ CMPIStatus stat_logicalfile_and_fill( fsname = (char *) KChars(lf->lf.datafile.FSName.value); fsclassname = (char *) KChars(lf->lf.datafile.FSCreationClassName.value); st = get_fsinfo_from_stat(b, &sb, path, &fsclassname, &fsname); - lmi_check_status(st); + lmi_return_if_status_not_ok(st); switch(mode) { case S_IFREG: diff --git a/src/logicalfile/file.h b/src/logicalfile/file.h index a5291ed..518cc77 100644 --- a/src/logicalfile/file.h +++ b/src/logicalfile/file.h @@ -59,11 +59,11 @@ const char *provider_name; ) #define fill_logicalfile(type, obj, name, fsclassname, fsname, creation_class) \ - type##_Set_Name((obj), (name)); \ - type##_Set_CSCreationClassName((obj), get_system_creation_class_name()); \ - type##_Set_CSName((obj), get_system_name()); \ - type##_Set_FSCreationClassName((obj), fsclassname); \ - type##_Set_FSName((obj), (fsname)); \ + type##_Set_Name((obj), (name)); \ + type##_Set_CSCreationClassName((obj), lmi_get_system_creation_class_name()); \ + type##_Set_CSName((obj), lmi_get_system_name()); \ + type##_Set_FSCreationClassName((obj), fsclassname); \ + type##_Set_FSName((obj), (fsname)); \ type##_Set_CreationClassName((obj), (creation_class)); #define fill_basic(b, cmpitype, lmi_file, creation_class_name, fsclassname, fsname, sb) \ diff --git a/src/power/LMI_AssociatedPowerManagementServiceProvider.c b/src/power/LMI_AssociatedPowerManagementServiceProvider.c index 25cfc9c..04bd5fb 100644 --- a/src/power/LMI_AssociatedPowerManagementServiceProvider.c +++ b/src/power/LMI_AssociatedPowerManagementServiceProvider.c @@ -74,10 +74,10 @@ static CMPIStatus LMI_AssociatedPowerManagementServiceEnumInstances( LMI_PowerManagementServiceRef powerManagementServiceRef; LMI_PowerManagementServiceRef_Init(&powerManagementServiceRef, _cb, ns); - LMI_PowerManagementServiceRef_Set_Name(&powerManagementServiceRef, get_system_name()); - LMI_PowerManagementServiceRef_Set_SystemName(&powerManagementServiceRef, get_system_name()); + LMI_PowerManagementServiceRef_Set_Name(&powerManagementServiceRef, lmi_get_system_name()); + LMI_PowerManagementServiceRef_Set_SystemName(&powerManagementServiceRef, lmi_get_system_name()); LMI_PowerManagementServiceRef_Set_CreationClassName(&powerManagementServiceRef, "LMI_PowerManagementService"); - LMI_PowerManagementServiceRef_Set_SystemCreationClassName(&powerManagementServiceRef, get_system_creation_class_name()); + LMI_PowerManagementServiceRef_Set_SystemCreationClassName(&powerManagementServiceRef, lmi_get_system_creation_class_name()); LMI_AssociatedPowerManagementService_Set_ServiceProvided(&w, &powerManagementServiceRef); int count; diff --git a/src/power/LMI_ElementCapabilitiesProvider.c b/src/power/LMI_ElementCapabilitiesProvider.c index 7d7d58f..f8875e1 100644 --- a/src/power/LMI_ElementCapabilitiesProvider.c +++ b/src/power/LMI_ElementCapabilitiesProvider.c @@ -70,10 +70,10 @@ static CMPIStatus LMI_ElementCapabilitiesEnumInstances( LMI_PowerManagementServiceRef powerManagementServiceRef; LMI_PowerManagementServiceRef_Init(&powerManagementServiceRef, _cb, ns); - LMI_PowerManagementServiceRef_Set_Name(&powerManagementServiceRef, get_system_name()); - LMI_PowerManagementServiceRef_Set_SystemName(&powerManagementServiceRef, get_system_name()); + LMI_PowerManagementServiceRef_Set_Name(&powerManagementServiceRef, lmi_get_system_name()); + LMI_PowerManagementServiceRef_Set_SystemName(&powerManagementServiceRef, lmi_get_system_name()); LMI_PowerManagementServiceRef_Set_CreationClassName(&powerManagementServiceRef, "LMI_PowerManagementService"); - LMI_PowerManagementServiceRef_Set_SystemCreationClassName(&powerManagementServiceRef, get_system_creation_class_name()); + LMI_PowerManagementServiceRef_Set_SystemCreationClassName(&powerManagementServiceRef, lmi_get_system_creation_class_name()); LMI_ElementCapabilities_Set_ManagedElement(&w, &powerManagementServiceRef); diff --git a/src/power/LMI_HostedPowerManagementServiceProvider.c b/src/power/LMI_HostedPowerManagementServiceProvider.c index 80f0111..993d676 100644 --- a/src/power/LMI_HostedPowerManagementServiceProvider.c +++ b/src/power/LMI_HostedPowerManagementServiceProvider.c @@ -74,10 +74,10 @@ static CMPIStatus LMI_HostedPowerManagementServiceEnumInstances( LMI_PowerManagementServiceRef powerManagementServiceRef; LMI_PowerManagementServiceRef_Init(&powerManagementServiceRef, _cb, ns); - LMI_PowerManagementServiceRef_Set_Name(&powerManagementServiceRef, get_system_name()); - LMI_PowerManagementServiceRef_Set_SystemName(&powerManagementServiceRef, get_system_name()); + LMI_PowerManagementServiceRef_Set_Name(&powerManagementServiceRef, lmi_get_system_name()); + LMI_PowerManagementServiceRef_Set_SystemName(&powerManagementServiceRef, lmi_get_system_name()); LMI_PowerManagementServiceRef_Set_CreationClassName(&powerManagementServiceRef, "LMI_PowerManagementService"); - LMI_PowerManagementServiceRef_Set_SystemCreationClassName(&powerManagementServiceRef, get_system_creation_class_name()); + LMI_PowerManagementServiceRef_Set_SystemCreationClassName(&powerManagementServiceRef, lmi_get_system_creation_class_name()); LMI_HostedPowerManagementService_Set_Dependent(&w, &powerManagementServiceRef); KReturnInstance(cr, w); diff --git a/src/power/LMI_PowerManagementServiceProvider.c b/src/power/LMI_PowerManagementServiceProvider.c index 162d798..a4778ab 100644 --- a/src/power/LMI_PowerManagementServiceProvider.c +++ b/src/power/LMI_PowerManagementServiceProvider.c @@ -67,9 +67,9 @@ static CMPIStatus LMI_PowerManagementServiceEnumInstances( LMI_PowerManagementService_Init(&w, _cb, KNameSpace(cop)); LMI_PowerManagementService_Set_CreationClassName(&w, "LMI_PowerManagementService"); - LMI_PowerManagementService_Set_Name(&w, get_system_name()); - LMI_PowerManagementService_Set_SystemCreationClassName(&w, get_system_creation_class_name()); - LMI_PowerManagementService_Set_SystemName(&w, get_system_name()); + LMI_PowerManagementService_Set_Name(&w, lmi_get_system_name()); + LMI_PowerManagementService_Set_SystemCreationClassName(&w, lmi_get_system_creation_class_name()); + LMI_PowerManagementService_Set_SystemName(&w, lmi_get_system_name()); /* EnabledState is an integer enumeration that indicates the enabled * and disabled states of an element. It can also indicate the transitions diff --git a/src/realmd/LMI_HostedRealmdServiceProvider.c b/src/realmd/LMI_HostedRealmdServiceProvider.c index eecedbb..08184d2 100644 --- a/src/realmd/LMI_HostedRealmdServiceProvider.c +++ b/src/realmd/LMI_HostedRealmdServiceProvider.c @@ -40,7 +40,7 @@ static CMPIStatus LMI_HostedRealmdServiceEnumInstances( LMI_HostedRealmdService hosted_realmd_service; const char *name_space = KNameSpace(cop); - const char *host_name = get_system_name(); + const char *host_name = lmi_get_system_name(); CMSetStatus(&status, CMPI_RC_OK); diff --git a/src/realmd/LMI_RealmdServiceProvider.c b/src/realmd/LMI_RealmdServiceProvider.c index d69e290..7680580 100644 --- a/src/realmd/LMI_RealmdServiceProvider.c +++ b/src/realmd/LMI_RealmdServiceProvider.c @@ -94,7 +94,7 @@ static CMPIStatus LMI_RealmdServiceEnumInstances( GError *g_error = NULL; LMI_RealmdService lmi_realmd_service; const char *name_space = KNameSpace(cop); - const char *host_name = get_system_name(); + const char *host_name = lmi_get_system_name(); GVariant *provider_props = NULL; gchar *joined_domain = NULL; diff --git a/src/realmd/rdcp_util.h b/src/realmd/rdcp_util.h index c45fb73..5af5ca9 100644 --- a/src/realmd/rdcp_util.h +++ b/src/realmd/rdcp_util.h @@ -37,7 +37,7 @@ const ConfigEntry *provider_config_defaults; klass##_Init(obj, _cb, name_space); \ klass##_Set_Name(obj, REALMD_SERVICE_NAME); \ klass##_Set_SystemCreationClassName(obj, \ - get_system_creation_class_name()); \ + lmi_get_system_creation_class_name()); \ klass##_Set_SystemName(obj, host_name); \ klass##_Set_CreationClassName(obj, \ LMI_RealmdService_ClassName); \ diff --git a/src/service-dbus/LMI_ServiceProvider.c b/src/service-dbus/LMI_ServiceProvider.c index 1f370c1..c3d5938 100644 --- a/src/service-dbus/LMI_ServiceProvider.c +++ b/src/service-dbus/LMI_ServiceProvider.c @@ -58,8 +58,8 @@ static CMPIStatus LMI_ServiceEnumInstanceNames( LMI_ServiceRef w; LMI_ServiceRef_Init(&w, _cb, ns); LMI_ServiceRef_Set_CreationClassName(&w, LMI_Service_ClassName); - LMI_ServiceRef_Set_SystemCreationClassName(&w, get_system_creation_class_name()); - LMI_ServiceRef_Set_SystemName(&w, get_system_name()); + LMI_ServiceRef_Set_SystemCreationClassName(&w, lmi_get_system_creation_class_name()); + LMI_ServiceRef_Set_SystemName(&w, lmi_get_system_name()); LMI_ServiceRef_Set_Name(&w, slist->name[i]); CMReturnObjectPath(cr, LMI_ServiceRef_ToObjectPath(&w, NULL)); @@ -85,8 +85,8 @@ static CMPIStatus LMI_ServiceEnumInstances( LMI_Service w; LMI_Service_InitFromObjectPath(&w, _cb, cop); LMI_Service_Set_CreationClassName(&w, LMI_Service_ClassName); - LMI_Service_Set_SystemCreationClassName(&w, get_system_creation_class_name()); - LMI_Service_Set_SystemName(&w, get_system_name()); + LMI_Service_Set_SystemCreationClassName(&w, lmi_get_system_creation_class_name()); + LMI_Service_Set_SystemName(&w, lmi_get_system_name()); LMI_Service_Set_Name(&w, svcs->svc[i]->svName); LMI_Service_Set_Status(&w, svcs->svc[i]->svStatus); LMI_Service_Set_Started(&w, svcs->svc[i]->svStarted); diff --git a/src/service/LMI_ServiceProvider.c b/src/service/LMI_ServiceProvider.c index 355e49c..dec539d 100644 --- a/src/service/LMI_ServiceProvider.c +++ b/src/service/LMI_ServiceProvider.c @@ -53,8 +53,8 @@ static CMPIStatus LMI_ServiceEnumInstanceNames( LMI_ServiceRef w; LMI_ServiceRef_Init(&w, _cb, ns); LMI_ServiceRef_Set_CreationClassName(&w, "LMI_Service"); - LMI_ServiceRef_Set_SystemCreationClassName(&w, get_system_creation_class_name()); - LMI_ServiceRef_Set_SystemName(&w, get_system_name()); + LMI_ServiceRef_Set_SystemCreationClassName(&w, lmi_get_system_creation_class_name()); + LMI_ServiceRef_Set_SystemName(&w, lmi_get_system_name()); LMI_ServiceRef_Set_Name(&w, slist->name[i]); KReturnObjectPath(cr, w); diff --git a/src/software-dbus/LMI_SoftwareIdentityResourceProvider.c b/src/software-dbus/LMI_SoftwareIdentityResourceProvider.c index fec2794..d321b30 100644 --- a/src/software-dbus/LMI_SoftwareIdentityResourceProvider.c +++ b/src/software-dbus/LMI_SoftwareIdentityResourceProvider.c @@ -84,11 +84,11 @@ static CMPIStatus LMI_SoftwareIdentityResourceEnumInstances( LMI_SoftwareIdentityResource w; LMI_SoftwareIdentityResource_Init(&w, _cb, KNameSpace(cop)); - LMI_SoftwareIdentityResource_Set_SystemName(&w, get_system_name()); + LMI_SoftwareIdentityResource_Set_SystemName(&w, lmi_get_system_name()); LMI_SoftwareIdentityResource_Set_CreationClassName(&w, ORGID "_" SW_IDENTITY_RESOURCE_CLASS_NAME); LMI_SoftwareIdentityResource_Set_SystemCreationClassName(&w, - get_system_creation_class_name()); + lmi_get_system_creation_class_name()); LMI_SoftwareIdentityResource_Set_Name(&w, repo_id); LMI_SoftwareIdentityResource_Set_AccessContext(&w, |