summaryrefslogtreecommitdiffstats
path: root/src/logicalfile/LMI_FileIdentityProvider.c
diff options
context:
space:
mode:
authorJan Synacek <jsynacek@redhat.com>2013-12-17 10:27:15 +0100
committerJan Synacek <jsynacek@redhat.com>2013-12-17 11:11:03 +0100
commit67ae76aecfac0b04f22bea07b87bd7a8ce04a711 (patch)
tree55da46583bc833564ff8a27625dff80565342e9e /src/logicalfile/LMI_FileIdentityProvider.c
parent9a3adaf677fe49c016774c98e016140055c36afb (diff)
downloadopenlmi-providers-67ae76aecfac0b04f22bea07b87bd7a8ce04a711.tar.gz
openlmi-providers-67ae76aecfac0b04f22bea07b87bd7a8ce04a711.tar.xz
openlmi-providers-67ae76aecfac0b04f22bea07b87bd7a8ce04a711.zip
logicalfile: correctly fill FSCreationClassName and FSName
Files residing on nodevice or remote filesystems now correctly set these properties. FSCreationClassName is set to "LMI_TransientFileSystem" and FSName is set to "PATH=<path to file>". This behavior is consistent with how storage providers set those properties. To check for filesystem, the provider uses udev and checks for ID_FS_UUID_ENC and DEVNAME fields. If these are not found, filesystem is then considered nodevice or remote. Additional test for files on transient filesystems has been added.
Diffstat (limited to 'src/logicalfile/LMI_FileIdentityProvider.c')
-rw-r--r--src/logicalfile/LMI_FileIdentityProvider.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/logicalfile/LMI_FileIdentityProvider.c b/src/logicalfile/LMI_FileIdentityProvider.c
index 514f5c3..90c5cbe 100644
--- a/src/logicalfile/LMI_FileIdentityProvider.c
+++ b/src/logicalfile/LMI_FileIdentityProvider.c
@@ -46,6 +46,7 @@ static CMPIStatus associators(
const char *path;
char fileclass[BUFLEN];
char *fsname;
+ char *fsclassname;
st = check_assoc_class(_cb, ns, assocClass, LMI_FileIdentity_ClassName);
check_class_check_status(st);
@@ -57,7 +58,7 @@ static CMPIStatus associators(
path = get_string_property_from_op(cop, "LFName");
get_class_from_path(path, fileclass);
- st = get_fsname_from_path(_cb, path, &fsname);
+ st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname);
check_status(st);
st = check_assoc_class(_cb, ns, resultClass, fileclass);
@@ -71,7 +72,7 @@ static CMPIStatus associators(
CIM_LogicalFileRef cim_lfr;
CIM_LogicalFileRef_Init(&cim_lfr, _cb, ns);
- fill_logicalfile(CIM_LogicalFileRef, &cim_lfr, path, fsname, fileclass);
+ fill_logicalfile(CIM_LogicalFileRef, &cim_lfr, path, fsclassname, fsname, fileclass);
o = CIM_LogicalFileRef_ToObjectPath(&cim_lfr, &st);
CMSetClassName(o, fileclass);
} else if (CMClassPathIsA(_cb, cop, CIM_LogicalFile_ClassName, &st)) {
@@ -91,7 +92,7 @@ static CMPIStatus associators(
}
get_class_from_path(path, fileclass);
- st = get_fsname_from_path(_cb, path, &fsname);
+ st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname);
check_status(st);
LMI_UnixFile lmi_uf;
@@ -99,7 +100,7 @@ static CMPIStatus associators(
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_FSCreationClassName(&lmi_uf, FSCREATIONCLASSNAME);
+ LMI_UnixFile_Set_FSCreationClassName(&lmi_uf, fsclassname);
LMI_UnixFile_Set_FSName(&lmi_uf, fsname);
LMI_UnixFile_Set_LFCreationClassName(&lmi_uf, fileclass);
o = LMI_UnixFile_ToObjectPath(&lmi_uf, &st);
@@ -136,6 +137,7 @@ static CMPIStatus references(
const char *path;
char fileclass[BUFLEN];
char *fsname;
+ char *fsclassname;
st = check_assoc_class(_cb, ns, assocClass, LMI_FileIdentity_ClassName);
check_class_check_status(st);
@@ -153,7 +155,7 @@ static CMPIStatus references(
path = get_string_property_from_op(cop, "LFName");
get_class_from_path(path, fileclass);
- st = get_fsname_from_path(_cb, path, &fsname);
+ st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname);
check_status(st);
if (role && strcmp(role, SAME_ELEMENT) != 0) {
@@ -163,7 +165,7 @@ static CMPIStatus references(
/* SystemElement */
CIM_LogicalFileRef lmi_lfr;
CIM_LogicalFileRef_Init(&lmi_lfr, _cb, ns);
- fill_logicalfile(CIM_LogicalFileRef, &lmi_lfr, path, fsname, fileclass);
+ fill_logicalfile(CIM_LogicalFileRef, &lmi_lfr, path, fsclassname, fsname, fileclass);
o = CIM_LogicalFileRef_ToObjectPath(&lmi_lfr, &st);
CMSetClassName(o, fileclass);
@@ -182,7 +184,7 @@ static CMPIStatus references(
}
path = get_string_property_from_op(cop, "Name");
get_class_from_path(path, fileclass);
- st = get_fsname_from_path(_cb, path, &fsname);
+ st = get_fsinfo_from_path(_cb, path, &fsclassname, &fsname);
check_status(st);
/* SameElement */
@@ -191,7 +193,7 @@ static CMPIStatus references(
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_FSCreationClassName(&lmi_uf, FSCREATIONCLASSNAME);
+ LMI_UnixFile_Set_FSCreationClassName(&lmi_uf, fsclassname);
LMI_UnixFile_Set_FSName(&lmi_uf, fsname);
LMI_UnixFile_Set_LFCreationClassName(&lmi_uf, fileclass);
o = LMI_UnixFile_ToObjectPath(&lmi_uf, &st);