CBL-Mariner/SPECS-EXTENDED/sblim-cmpi-fsvol/sblim-cmpi-fsvol-1.5.0-ext4...

186 строки
8.7 KiB
Diff
Исходник Обычный вид История

diff -up sblim-cmpi-fsvol-1.5.0/cmpiOSBase_BootOSFromFS.c.orig sblim-cmpi-fsvol-1.5.0/cmpiOSBase_BootOSFromFS.c
--- sblim-cmpi-fsvol-1.5.0/cmpiOSBase_BootOSFromFS.c.orig 2010-12-21 13:49:17.000000000 +0100
+++ sblim-cmpi-fsvol-1.5.0/cmpiOSBase_BootOSFromFS.c 2010-12-21 13:50:01.000000000 +0100
@@ -363,7 +363,8 @@ int _assoc_BootOSFromFS( const CMPIBroke
}
else if( strcasecmp(CMGetCharPtr(sourceClass), _RefLeftClassExt2 ) == 0 ||
strcasecmp(CMGetCharPtr(sourceClass), _RefLeftClassExt3 ) == 0 ||
- strcasecmp(CMGetCharPtr(sourceClass), _RefLeftClassReiser ) == 0 ) {
+ strcasecmp(CMGetCharPtr(sourceClass), _RefLeftClassReiser ) == 0 ||
+ strcasecmp(CMGetCharPtr(sourceClass), _RefLeftClassExt4 ) == 0 ) {
dt_name = CMGetKey( ref, "Name", rc);
if( dt_name.value.string == NULL ) {
diff -up sblim-cmpi-fsvol-1.5.0/cmpiOSBase_BootOSFromFS.h.orig sblim-cmpi-fsvol-1.5.0/cmpiOSBase_BootOSFromFS.h
--- sblim-cmpi-fsvol-1.5.0/cmpiOSBase_BootOSFromFS.h.orig 2010-12-21 13:50:14.000000000 +0100
+++ sblim-cmpi-fsvol-1.5.0/cmpiOSBase_BootOSFromFS.h 2010-12-21 13:50:41.000000000 +0100
@@ -40,6 +40,7 @@ static char * _RefLeftClass_bk = "CIM
static char * _RefLeftClassExt2 = "Linux_Ext2FileSystem";
static char * _RefLeftClassExt3 = "Linux_Ext3FileSystem";
static char * _RefLeftClassReiser = "Linux_ReiserFileSystem";
+static char * _RefLeftClassExt4 = "Linux_Ext4FileSystem";
static char * _RefRightClass = "Linux_OperatingSystem";
/* ---------------------------------------------------------------------------*/
diff -up sblim-cmpi-fsvol-1.5.0/cmpiOSBase_BootOSFromFSProvider.c.orig sblim-cmpi-fsvol-1.5.0/cmpiOSBase_BootOSFromFSProvider.c
--- sblim-cmpi-fsvol-1.5.0/cmpiOSBase_BootOSFromFSProvider.c.orig 2010-12-21 13:51:24.000000000 +0100
+++ sblim-cmpi-fsvol-1.5.0/cmpiOSBase_BootOSFromFSProvider.c 2010-12-21 13:52:46.000000000 +0100
@@ -316,6 +316,9 @@ CMPIStatus OSBase_BootOSFromFSProviderAs
else if( strcasecmp(resultClass,_RefLeftClassReiser) == 0 ) {
_RefLeftClass = _RefLeftClassReiser;
}
+ else if( strcasecmp(resultClass,_RefLeftClassExt4) == 0 ) {
+ _RefLeftClass = _RefLeftClassExt4;
+ }
else { goto exit; }
}
}
@@ -386,6 +389,9 @@ CMPIStatus OSBase_BootOSFromFSProviderAs
else if( strcasecmp(resultClass,_RefLeftClassReiser) == 0 ) {
_RefLeftClass = _RefLeftClassReiser;
}
+ else if( strcasecmp(resultClass,_RefLeftClassExt4) == 0 ) {
+ _RefLeftClass = _RefLeftClassExt4;
+ }
else { goto exit; }
}
}
diff -up sblim-cmpi-fsvol-1.5.0/cmpiOSBase_CommonFsvol.c.orig sblim-cmpi-fsvol-1.5.0/cmpiOSBase_CommonFsvol.c
--- sblim-cmpi-fsvol-1.5.0/cmpiOSBase_CommonFsvol.c.orig 2010-12-21 13:53:03.000000000 +0100
+++ sblim-cmpi-fsvol-1.5.0/cmpiOSBase_CommonFsvol.c 2010-12-21 13:53:58.000000000 +0100
@@ -135,6 +135,11 @@ int get_fs_of_dir( const char * dir , ch
strcpy( fsc , "Linux_ReiserFileSystem");
*fscname = fsc ;
}
+ if( strcmp( me->mnt_type, "ext4") == 0 ) {
+ fsc = calloc(1,21);
+ strcpy( fsc , "Linux_Ext4FileSystem");
+ *fscname = fsc ;
+ }
break;
}
me = NULL ;
diff -up sblim-cmpi-fsvol-1.5.0/cmpiOSBase_LocalFileSystem.c.orig sblim-cmpi-fsvol-1.5.0/cmpiOSBase_LocalFileSystem.c
--- sblim-cmpi-fsvol-1.5.0/cmpiOSBase_LocalFileSystem.c.orig 2010-12-21 13:54:21.000000000 +0100
+++ sblim-cmpi-fsvol-1.5.0/cmpiOSBase_LocalFileSystem.c 2010-12-21 13:57:39.000000000 +0100
@@ -189,6 +189,17 @@ CMPIInstance * _makeInst_LocalFileSystem
} /* end of scope "reiserfs" */
+ /* Linux_Ext4FileSystem */
+ if( scope == 4 || ( scope==0 && strcmp(sptr->mnt_type,"ext4")==0) ) {
+ op = CMNewObjectPath( _broker, CMGetCharPtr(CMGetNameSpace(ref,rc)),
+ _ClassExt4, rc );
+ if( CMIsNullObject(op) ) {
+ CMSetStatusWithChars( _broker, rc,
+ CMPI_RC_ERR_FAILED, "Create CMPIObjectPath failed." );
+ _OSBASE_TRACE(2,("--- _makeInst_LocalFileSystem() failed : %s",CMGetCharPtr(rc->msg)));
+ goto exit;
+ }
+ } /* end of scope "ext4" */
ci = CMNewInstance( _broker, op, rc);
if( CMIsNullObject(ci) ) {
@@ -226,6 +237,12 @@ CMPIInstance * _makeInst_LocalFileSystem
CMSetProperty( ci, "Caption", "Reiser local file system", CMPI_chars);
}
+ /* Linux_Ext4FileSystem */
+ if( scope == 4 || ( scope==0 && strcmp(sptr->mnt_type,"ext4")==0) ) {
+ CMSetProperty( ci, "CreationClassName", _ClassExt4, CMPI_chars );
+ CMSetProperty( ci, "Caption", "Ext4 local file system", CMPI_chars);
+ }
+
CMSetProperty( ci, "CSCreationClassName", CSCreationClassName, CMPI_chars );
CMSetProperty( ci, "CSName", get_system_name(), CMPI_chars );
CMSetProperty( ci, "Name", sptr->mnt_fsname, CMPI_chars );
@@ -290,6 +307,7 @@ void _get_class_scope( const CMPIObjectP
* 1 = ext2
* 2 = ext3
* 3 = reiserfs
+ * 4 = ext4
*/
className = CMGetClassName(ref, rc);
@@ -300,6 +318,8 @@ void _get_class_scope( const CMPIObjectP
*scope = 2;
else if( strcasecmp(CMGetCharPtr(className), _ClassReiser) == 0 )
*scope = 3;
+ else if( strcasecmp(CMGetCharPtr(className), _ClassExt4) == 0 )
+ *scope = 4;
else
*scope = 0;
}
@@ -321,6 +341,8 @@ int _valid_class_and_fstype_combination(
if( scope==3 && strcmp(type,"reiserfs")==0 )
return 1;
+ if( scope==4 && strcmp(type,"ext4")==0 )
+ return 1;
return 0;
}
diff -up sblim-cmpi-fsvol-1.5.0/cmpiOSBase_LocalFileSystem.h.orig sblim-cmpi-fsvol-1.5.0/cmpiOSBase_LocalFileSystem.h
--- sblim-cmpi-fsvol-1.5.0/cmpiOSBase_LocalFileSystem.h.orig 2010-12-21 13:57:51.000000000 +0100
+++ sblim-cmpi-fsvol-1.5.0/cmpiOSBase_LocalFileSystem.h 2010-12-21 13:58:11.000000000 +0100
@@ -36,6 +36,7 @@ static char * _ClassName = "CIM_UnixLo
static char * _ClassExt2 = "Linux_Ext2FileSystem";
static char * _ClassExt3 = "Linux_Ext3FileSystem";
static char * _ClassReiser = "Linux_ReiserFileSystem";
+static char * _ClassExt4 = "Linux_Ext4FileSystem";
/* ---------------------------------------------------------------------------*/
diff -up sblim-cmpi-fsvol-1.5.0/mof/Linux_Fsvol.mof.orig sblim-cmpi-fsvol-1.5.0/mof/Linux_Fsvol.mof
--- sblim-cmpi-fsvol-1.5.0/mof/Linux_Fsvol.mof.orig 2010-12-21 13:58:26.000000000 +0100
+++ sblim-cmpi-fsvol-1.5.0/mof/Linux_Fsvol.mof 2010-12-21 13:59:12.000000000 +0100
@@ -59,6 +59,14 @@ class Linux_ReiserFileSystem : CIM_UnixL
uint8 PercentageSpaceUse;
};
+[ Provider("cmpi:cmpiOSBase_LocalFileSystemProvider"),
+ Description ("The Linux local filesystem of type ext4.")
+]
+class Linux_Ext4FileSystem : CIM_UnixLocalFileSystem
+{
+ uint8 PercentageSpaceUse;
+};
+
// ===================================================================
// Linux_NFS
diff -up sblim-cmpi-fsvol-1.5.0/mof/Linux_Fsvol.registration.orig sblim-cmpi-fsvol-1.5.0/mof/Linux_Fsvol.registration
--- sblim-cmpi-fsvol-1.5.0/mof/Linux_Fsvol.registration.orig 2010-12-21 13:59:30.000000000 +0100
+++ sblim-cmpi-fsvol-1.5.0/mof/Linux_Fsvol.registration 2010-12-21 13:59:57.000000000 +0100
@@ -2,6 +2,7 @@
Linux_Ext2FileSystem root/cimv2 OSBase_LocalFileSystemProvider cmpiOSBase_LocalFileSystemProvider instance
Linux_Ext3FileSystem root/cimv2 OSBase_LocalFileSystemProvider cmpiOSBase_LocalFileSystemProvider instance
Linux_ReiserFileSystem root/cimv2 OSBase_LocalFileSystemProvider cmpiOSBase_LocalFileSystemProvider instance
+Linux_Ext4FileSystem root/cimv2 OSBase_LocalFileSystemProvider cmpiOSBase_LocalFileSystemProvider instance
Linux_NFS root/cimv2 OSBase_NFSProvider cmpiOSBase_NFSProvider instance
Linux_HostedFileSystem root/cimv2 OSBase_HostedFileSystemProvider cmpiOSBase_HostedFileSystemProvider instance association
Linux_BootOSFromFS root/cimv2 OSBase_BootOSFromFSProvider cmpiOSBase_BootOSFromFSProvider instance association
diff -up sblim-cmpi-fsvol-1.5.0/OSBase_LocalFileSystem.c.orig sblim-cmpi-fsvol-1.5.0/OSBase_LocalFileSystem.c
--- sblim-cmpi-fsvol-1.5.0/OSBase_LocalFileSystem.c.orig 2010-12-21 13:47:04.000000000 +0100
+++ sblim-cmpi-fsvol-1.5.0/OSBase_LocalFileSystem.c 2010-12-21 13:48:47.000000000 +0100
@@ -64,7 +64,8 @@ int enum_all_localfs( struct mntlist **
while ( ( me = getmntent_r(tab,&mebuf,mntbuf,sizeof(mntbuf))) != NULL ) {
if ( (strcmp("ext2",me->mnt_type) == 0) ||
(strcmp("ext3",me->mnt_type) == 0) ||
- (strcmp("reiserfs",me->mnt_type) == 0) ) {
+ (strcmp("reiserfs",me->mnt_type) == 0) ||
+ (strcmp("ext4",me->mnt_type) == 0) ) {
if (mel->me != NULL ) {
mel->next = calloc (1, sizeof (struct mntlist) );
@@ -85,7 +86,8 @@ int enum_all_localfs( struct mntlist **
while ( ( me = getmntent_r(tab,&mebuf,mntbuf,sizeof(mntbuf))) != NULL ) {
if ( (strcmp("ext2",me->mnt_type) == 0) ||
(strcmp("ext3",me->mnt_type) == 0) ||
- (strcmp("reiserfs",me->mnt_type) == 0) ) {
+ (strcmp("reiserfs",me->mnt_type) == 0) ||
+ (strcmp("ext4",me->mnt_type) == 0) ) {
ml = *ls;
add = 1;