From: Heidi E. <hei...@us...> - 2005-04-20 11:40:31
|
Update of /cvsroot/sblim/cmpi-fsvol In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5454 Modified Files: AUTHORS ChangeLog Makefile.am README configure.ac Added Files: OSBase_BlockStorageStatisticalData.c OSBase_BlockStorageStatisticalData.h cmpiOSBase_BlockStorageStatisticalData.c cmpiOSBase_BlockStorageStatisticalData.h cmpiOSBase_BlockStorageStatisticalDataProvider.c Log Message: feature request# 1186595: support for LogicalDisk statistical data added ... contribution by Michael Schuele :) ... thx --- NEW FILE: cmpiOSBase_BlockStorageStatisticalData.h --- #ifndef _CMPIOSBASE_BLOCKSTORAGESTATISTICALDATA_H_ #define _CMPIOSBASE_BLOCKSTORAGESTATISTICALDATA_H_ /* * cmpiOSBase_BlockStorageStatisticalData.h * * (C) Copyright IBM Corp. 2004, 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Interface Type : Common Magabeablity Programming Interface ( CMPI ) * * Description: * This file defines the interfaces for the factory implementation of the * CIM class Linux_BlockStorageStatisticalData. * */ /* ---------------------------------------------------------------------------*/ #include "cmpidt.h" #include "OSBase_BlockStorageStatisticalData.h" /* ---------------------------------------------------------------------------*/ static char * _ClassName = "Linux_BlockStorageStatisticalData"; static const char * _INSTANCE_PREFIX = "Linux:"; static int _INSTANCE_PREFIX_LENGTH = 6; /* ---------------------------------------------------------------------------*/ /* method to create a CMPIObjectPath of this class */ CMPIObjectPath * _makePath_BlockStorageStatisticalData(CMPIBroker * _broker, CMPIContext * ctx, CMPIObjectPath * cop, CMPIStatus * rc, struct disk_data *disk); /* method to create a CMPIInstance of this class */ CMPIInstance * _makeInst_BlockStorageStatisticalData(CMPIBroker * _broker, CMPIContext * ctx, CMPIObjectPath * cop, const char ** properties, CMPIStatus * rc, struct disk_data *disk); /* ---------------------------------------------------------------------------*/ #endif Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/configure.ac,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- configure.ac 19 Apr 2005 16:00:13 -0000 1.2 +++ configure.ac 20 Apr 2005 11:40:19 -0000 1.3 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(SBLIM BaseOS Filesystem Providers, 1.3.0, sbl...@li...,sblim-cmpi-fsvol) +AC_INIT(SBLIM BaseOS Filesystem Providers, 1.4.0, sbl...@li...,sblim-cmpi-fsvol) AC_CONFIG_SRCDIR([OSBase_CommonFsvol.c]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 15 Apr 2005 14:28:15 -0000 1.1 +++ Makefile.am 20 Apr 2005 11:40:19 -0000 1.2 @@ -43,6 +43,7 @@ # OSBase CMPI provider libraries provider_LTLIBRARIES = libcmpiOSBase_LocalFileSystemProvider.la \ libcmpiOSBase_NFSProvider.la \ + libcmpiOSBase_BlockStorageStatisticalDataProvider.la \ libcmpiOSBase_HostedFileSystemProvider.la \ libcmpiOSBase_BootOSFromFSProvider.la @@ -62,6 +63,14 @@ libcmpiOSBase_NFSProvider_la_LIBADD = \ -lcmpiOSBase_CommonFsvol +# Block Storage Statistical Data +libcmpiOSBase_BlockStorageStatisticalDataProvider_la_SOURCES = \ + cmpiOSBase_BlockStorageStatisticalDataProvider.c \ + cmpiOSBase_BlockStorageStatisticalData.c \ + OSBase_BlockStorageStatisticalData.c +libcmpiOSBase_BlockStorageStatisticalDataProvider_la_LIBADD = \ + -lcmpiOSBase_CommonFsvol + # Hosted Filesystem (Association) libcmpiOSBase_HostedFileSystemProvider_la_SOURCES = \ cmpiOSBase_HostedFileSystemProvider.c @@ -88,8 +97,10 @@ # Non-Installable Header Files noinst_HEADERS = OSBase_LocalFileSystem.h \ OSBase_NFS.h \ + OSBase_BlockStorageStatisticalData.h \ cmpiOSBase_LocalFileSystem.h \ cmpiOSBase_NFS.h \ + cmpiOSBase_BlockStorageStatisticalData.h \ cmpiOSBase_BootOSFromFS.h # We must explicity add the RPM spec file to the distribution package @@ -146,6 +157,7 @@ test/cim/Linux_Ext3FileSystem.cim \ test/cim/Linux_HostedFileSystem.cim \ test/cim/Linux_NFS.cim \ + test/cim/Linux_BlockStorageStatisticalData.cim \ test/cim/Linux_ReiserFileSystem.cim runtest: install Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/ChangeLog,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ChangeLog 15 Apr 2005 14:28:15 -0000 1.1 +++ ChangeLog 20 Apr 2005 11:40:19 -0000 1.2 @@ -15,8 +15,15 @@ * test script accepts userID and password // =================================================================== -// new in version 1.3 : +// new in version 1.3.0 : * support for property list filter on EnumInstances and GetInstance // =================================================================== +// new in version 1.4.0 : + +* feature request# 1186595: added support for class + Linux_BlockStorageStatisticalData + ... contribution by Michael Schuele ... thx :) + +// =================================================================== Index: README =================================================================== RCS file: /cvsroot/sblim/cmpi-fsvol/README,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- README 15 Apr 2005 14:28:15 -0000 1.6 +++ README 20 Apr 2005 11:40:19 -0000 1.7 @@ -32,6 +32,7 @@ - Linux_Ext3FileSystem - Linux_ReiserFileSystem - Linux_NFS +- Linux_BlockStorageStatisticalData - Linux_HostedFileSystem - Linux_BootOSFromFS @@ -138,6 +139,12 @@ - cmpiOSBase_NFS.c/.h - OSBase_NFS.c/.h +class Linux_BlockStorageStatisticalData +........................... +- cmpiOSBase_BlockStorageStatisticalDataProvider.c +- cmpiOSBase_BlockStorageStatisticalData.c/.h +- OSBase_BlockStorageStatisticalData.c/.h + association Linux_HostedFileSystem ........................... --- NEW FILE: OSBase_BlockStorageStatisticalData.h --- #ifndef _LINUX_BLOCKSTORAGESTATISTICALDATA_H_ #define _LINUX_BLOCKSTORAGESTATISTICALDATA_H_ /* * Linux_BlockStorageStatisticalData.h * * (C) Copyright IBM Corp. 2004, 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Description: * This file defines the interfaces for the resource access implementation * of the CIM class Linux_BlockStorageStatisticalData * */ /* ---------------------------------------------------------------------------*/ //#include <pthread.h> #include <sys/types.h> #ifdef __cplusplus extern "C" { #endif //static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* ---------------------------------------------------------------------------*/ /** the data of one single drive */ struct disk_data { char *id; unsigned long long kb_read; unsigned long long kb_transfered; unsigned long long read_ios; unsigned long long write_ios; unsigned long long total_ios; unsigned long long io_time; }; /** the list of all known drives */ struct disk_list { struct disk_data *disk; struct disk_list *next; }; /** * Returns a list of all currently known disk drives * This function allocates memory which must be freed by * free_disk_list() (only if return value is not 0). * @param list the list is returned using this parameter * @return amount of available disk drives, 0 if no drive * was found. */ int enum_all_disks(struct disk_list **list); /** * Returns the current values of a specific disk drive. * This function allocates memory which must be freed by * free_disk() (only if return value is 1). * @param id a unique indentifier of the disk * @param disk the current data is returned using this parameter * @return 1 on success, 0 otherwise */ int get_disk_data(char *id, struct disk_data **disk); /** * Frees the memory allocated by enum_all_disks * @param list the list of all known drives returned by enum_all_disks * @see enum_all_disks */ void free_disk_list(struct disk_list *list); /** * Frees the memory allocated by a drive structure * @param drive the structure to free */ void free_disk(struct disk_data *disk); /** * Resets the given counters. * @param counters the counters to reset */ void reset_counters(); /* ---------------------------------------------------------------------------*/ #ifdef __cplusplus } #endif /* ---------------------------------------------------------------------------*/ #endif --- NEW FILE: cmpiOSBase_BlockStorageStatisticalData.c --- /* * cmpiOSBase_BlockStorageStatisticalData.c * * (C) Copyright IBM Corp. 2004, 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Interface Type : Common Magabeablity Programming Interface ( CMPI ) * * Description: * This is the factory implementation for creating instances of CIM * class Linux_BlockStorageStatisticalData. * */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include "cmpidt.h" #include "cmpimacs.h" #include "cmpiOSBase_Common.h" #include "OSBase_Common.h" #include "cmpiOSBase_BlockStorageStatisticalData.h" /* ---------------------------------------------------------------------------*/ /* private declarations */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Factory functions */ /* ---------------------------------------------------------------------------*/ /* ---------- method to create a CMPIObjectPath of this class ----------------*/ CMPIObjectPath * _makePath_BlockStorageStatisticalData(CMPIBroker * _broker, CMPIContext * ctx, CMPIObjectPath * ref, CMPIStatus * rc, struct disk_data *disk) { CMPIObjectPath * op = NULL; char * instanceID = NULL; char * hostname = NULL; _OSBASE_TRACE(2,("--- _makePath_BlockStorageStatisticalData() called")); op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(ref,rc)), _ClassName, rc ); if (CMIsNullObject(op)) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed." ); _OSBASE_TRACE(2,("--- _makePath_BlockStorageStatisticalData() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } /* keys are unique identifiers for an instance */ // Linux:<hostname>_<disk_id> hostname = get_system_name(); instanceID = calloc(_INSTANCE_PREFIX_LENGTH + strlen(hostname) + 1 + strlen(disk->id) + 1, sizeof(char)); strcpy(instanceID, _INSTANCE_PREFIX); strcat(instanceID, hostname); strcat(instanceID, "_"); strcat(instanceID, disk->id); CMAddKey(op, "InstanceID", instanceID, CMPI_chars); if (instanceID) free(instanceID); exit: _OSBASE_TRACE(2,("--- _makePath_BlockStorageStatisticalData() exited")); return op; } /* ----------- method to create a CMPIInstance of this class ----------------*/ CMPIInstance * _makeInst_BlockStorageStatisticalData(CMPIBroker * _broker, CMPIContext * ctx, CMPIObjectPath * ref, const char ** properties, CMPIStatus * rc, struct disk_data *disk) { CMPIObjectPath * op = NULL; CMPIInstance * ci = NULL; const char ** keys = NULL; int keyCount = 0; char * instanceID = NULL; CMPIDateTime * dt = NULL; char * hostname = NULL; _OSBASE_TRACE(2,("--- _makeInst_BlockStorageStatisticalData() called")); op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(ref,rc)), _ClassName, rc ); if (CMIsNullObject(op)) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed." ); _OSBASE_TRACE(2,("--- _makeInst_BlockStorageStatisticalData() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } ci = CMNewInstance( _broker, op, rc); if (CMIsNullObject(ci)) { CMSetStatusWithChars( _broker, rc, CMPI_RC_ERR_FAILED, "Create CMPIInstance failed." ); _OSBASE_TRACE(2,("--- _makeInst_BlockStorageStatisticalData() failed : %s",CMGetCharPtr(rc->msg))); goto exit; } /* set property filter */ /* keys = calloc(7,sizeof(char*)); keys[0] = strdup("CreationClassName"); keys[1] = strdup("DeviceCreationClassName"); keys[2] = strdup("DeviceID"); keys[3] = strdup("Name"); keys[4] = strdup("SystemCreationClassName"); keys[5] = strdup("SystemName"); keys[6] = NULL; CMSetPropertyFilter(ci,properties,keys); for( ;keys[keyCount]!=NULL;keyCount++) { free((char*)keys[keyCount]); } free(keys); */ // create instanceID: Linux:<hostname>_<disk_id> hostname = get_system_name(); instanceID = calloc(_INSTANCE_PREFIX_LENGTH + strlen(hostname) + 1 + strlen(disk->id) + 1, sizeof(char)); strcpy(instanceID, _INSTANCE_PREFIX); strcat(instanceID, hostname); strcat(instanceID, "_"); strcat(instanceID, disk->id); CMSetProperty(ci, "InstanceID", instanceID, CMPI_chars); if (instanceID) free(instanceID); /* from CIM_ManagedElement */ CMSetProperty(ci, "Caption", _ClassName, CMPI_chars); CMSetProperty(ci, "Description", "statistical information about disk drives", CMPI_chars); CMSetProperty(ci, "ElementName", disk->id, CMPI_chars); /* from CIM_StatisticalData */ // not supported CMSetProperty(ci, "StartStatisticTime", NULL, CMPI_dateTime); dt = CMNewDateTime(_broker,rc); CMSetProperty(ci, "StatisticTime", (CMPIValue*)&(dt), CMPI_dateTime); // there's no consistent time interval //CMSetProperty(ci, "SampleInterval", NULL, CMPI_uint64); /* from CIM_BlockStorageStatisticalData */ CMSetProperty(ci, "ReadIOs", (CMPIValue*)&(disk->read_ios), CMPI_uint64); CMSetProperty(ci, "WriteIOs", (CMPIValue*)&(disk->write_ios), CMPI_uint64); CMSetProperty(ci, "TotalIOs", (CMPIValue*)&(disk->total_ios), CMPI_uint64); CMSetProperty(ci, "KBytesRead", (CMPIValue*)&(disk->kb_read), CMPI_uint64); CMSetProperty(ci, "KBytesTransfered", (CMPIValue*)&(disk->kb_transfered), CMPI_uint64); CMSetProperty(ci, "IOTimeCounter", (CMPIValue*)&(disk->io_time), CMPI_uint64); exit: _OSBASE_TRACE(2,("--- _makeInst_BlockStorageStatisticalData() exited")); return ci; } /* ---------------------------------------------------------------------------*/ /* end of cmpiOSBase_BlockStorageStatisticalData.c */ /* ---------------------------------------------------------------------------*/ --- NEW FILE: cmpiOSBase_BlockStorageStatisticalDataProvider.c --- /* * cmpiOSBase_BlockStorageStatisticalData * * (C) Copyright IBM Corp. 2004, 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Interface Type : Common Manageability Programming Interface ( CMPI ) * * Description: Provider for BlockStorageStatisticalData * */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include "cmpidt.h" #include "cmpift.h" #include "cmpimacs.h" #include "OSBase_Common.h" #include "cmpiOSBase_Common.h" #include "cmpiOSBase_BlockStorageStatisticalData.h" static CMPIBroker * _broker; /* ---------------------------------------------------------------------------*/ /* private declarations */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OSBase_BlockStorageStatisticalDataProviderCleanup(CMPIInstanceMI * mi, CMPIContext * ctx) { _OSBASE_TRACE(1,("--- %s CMPI Cleanup() called",_ClassName)); CMReturn(CMPI_RC_OK); } CMPIStatus OSBase_BlockStorageStatisticalDataProviderEnumInstanceNames(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref) { CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIObjectPath * op = NULL; struct disk_list * disk_list = NULL; struct disk_list * list_backup = NULL; _OSBASE_TRACE(4,("--- CMPI EnumInstanceNames() entered")); enum_all_disks(&disk_list); _OSBASE_TRACE(1,("--- %s CMPI EnumInstanceNames() called",_ClassName)); if (disk_list == NULL) { _OSBASE_TRACE(1,("--- CMPI EnumInstanceNames() failed : no disks available")); return rc; } list_backup = disk_list; while (disk_list != NULL) { op = _makePath_BlockStorageStatisticalData(_broker,ctx,ref,&rc, disk_list->disk); if (op == NULL) { if (rc.msg != NULL) { _OSBASE_TRACE(1,("--%s CMPI EnumInstanceNames() failed : %s", _ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--%s CMPI EnumInstanceNames() failed", _ClassName)); } return rc; } CMReturnObjectPath(rslt, op); disk_list = disk_list->next; } if (list_backup) { free_disk_list(list_backup); } CMReturnDone(rslt); _OSBASE_TRACE(1,("--- %s CMPI EnumInstanceNames() exited",_ClassName)); return rc; } CMPIStatus OSBase_BlockStorageStatisticalDataProviderEnumInstances(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, char ** properties) { CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIInstance * ci = NULL; struct disk_list * disk_list = NULL; struct disk_list * list_backup = NULL; _OSBASE_TRACE(1,("--- %s CMPI EnumInstances() called",_ClassName)); enum_all_disks(&disk_list); list_backup = disk_list; if (disk_list == NULL) { _OSBASE_TRACE(1,("--- CMPI EnumInstances() failed : no disks available")); return rc; } while (disk_list != NULL) { ci = _makeInst_BlockStorageStatisticalData(_broker, ctx, ref, properties, &rc, disk_list->disk); if (ci == NULL) { if (rc.msg != NULL) { _OSBASE_TRACE(1,("--%s CMPI EnumInstances() failed : %s", _ClassName,CMGetCharPtr(rc.msg))); } else { _OSBASE_TRACE(1,("--%s CMPI EnumInstances() failed", _ClassName)); } return rc; } CMReturnInstance( rslt, ci ); disk_list = disk_list->next; } if (list_backup) free_disk_list(list_backup); CMReturnDone( rslt ); _OSBASE_TRACE(1,("--- %s CMPI EnumInstances() exited",_ClassName)); return rc; } CMPIStatus OSBase_BlockStorageStatisticalDataProviderGetInstance(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, char ** properties) { CMPIInstance * ci = NULL; CMPIStatus rc = {CMPI_RC_OK, NULL}; CMPIString * name = NULL; char * c_name = NULL; char * disk_id = NULL; struct disk_data * disk = NULL; int cmdrc = 0; _OSBASE_TRACE(1,("--- %s CMPI GetInstance() called",_ClassName)); name = CMGetKey( cop, "InstanceID", &rc).value.string; c_name = CMGetCharPtr(name); disk_id = strrchr(c_name,'_'); disk_id += 1; if (strlen(disk_id) <= 0) { CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_FAILED, "Could not get disk name." ); _OSBASE_TRACE(1,("--- %s CMPI GetInstance() failed for %s : %s",_ClassName,c_name,CMGetCharPtr(rc.msg))); return rc; } cmdrc = get_disk_data(disk_id, &disk); if (cmdrc == 0 || disk == NULL) { CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_FOUND, "disk does not exist"); _OSBASE_TRACE(1,("--- %s CMPI GetInstance() exited : %s",_ClassName,CMGetCharPtr(rc.msg))); if (disk) free_disk(disk); return rc; } ci = _makeInst_BlockStorageStatisticalData(_broker, ctx, cop, properties, &rc, disk); if (disk) free_disk(disk); CMReturnInstance( rslt, ci ); CMReturnDone(rslt); _OSBASE_TRACE(1,("--- %s CMPI GetInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_BlockStorageStatisticalDataProviderCreateInstance(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, CMPIInstance * ci) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI CreateInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI CreateInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_BlockStorageStatisticalDataProviderSetInstance(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop, CMPIInstance * ci, char **properties) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI SetInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI SetInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_BlockStorageStatisticalDataProviderDeleteInstance(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * cop) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI DeleteInstance() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI DeleteInstance() exited",_ClassName)); return rc; } CMPIStatus OSBase_BlockStorageStatisticalDataProviderExecQuery(CMPIInstanceMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, char * lang, char * query) { CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI ExecQuery() called",_ClassName)); CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, "CIM_ERR_NOT_SUPPORTED" ); _OSBASE_TRACE(1,("--- %s CMPI ExecQuery() exited",_ClassName)); return rc; } /* ---------------------------------------------------------------------------*/ /* Method Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus OSBase_BlockStorageStatisticalDataProviderMethodCleanup( CMPIMethodMI * mi, CMPIContext * ctx) { _OSBASE_TRACE(1,("--- %s CMPI MethodCleanup() called",_ClassName)); _OSBASE_TRACE(1,("--- %s CMPI MethodCleanup() exited",_ClassName)); CMReturn(CMPI_RC_OK); } CMPIStatus OSBase_BlockStorageStatisticalDataProviderInvokeMethod( CMPIMethodMI * mi, CMPIContext * ctx, CMPIResult * rslt, CMPIObjectPath * ref, const char * methodName, CMPIArgs * in, CMPIArgs * out) { CMPIString * class = NULL; CMPIStatus rc = {CMPI_RC_OK, NULL}; _OSBASE_TRACE(1,("--- %s CMPI InvokeMethod() called",_ClassName)); class = CMGetClassName(ref, &rc); if( strcasecmp(CMGetCharPtr(class), _ClassName) == 0 && strcasecmp("ResetSelectedStats",methodName) == 0 ) { CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_SUPPORTED, methodName ); } else { CMSetStatusWithChars( _broker, &rc, CMPI_RC_ERR_NOT_FOUND, methodName ); } _OSBASE_TRACE(1,("--- %s CMPI InvokeMethod() exited",_ClassName)); return rc; } /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ CMInstanceMIStub(OSBase_BlockStorageStatisticalDataProvider, OSBase_BlockStorageStatisticalDataProvider, _broker, CMNoHook); CMMethodMIStub( OSBase_BlockStorageStatisticalDataProvider, OSBase_BlockStorageStatisticalDataProvider, _broker, CMNoHook); /* ---------------------------------------------------------------------------*/ /* end of cmpiOSBase_BlockStorageStatisticalDataProvider */ /* ---------------------------------------------------------------------------*/ --- NEW FILE: OSBase_BlockStorageStatisticalData.c --- /* * Linux_BlockStorageStatisticalData.c * * (C) Copyright IBM Corp. 2004, 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * Author: Michael Schuele <sch...@de...> * Contributors: * * Description: * This s... [truncated message content] |