[PATCH 0 of 3] Renamed device function for constistency with other providers

Renamed the device_type_by_classname() to res_type_by_device_classname() for consistency with other interfaces.

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1204806486 -3600 # Node ID dc2deb288f0077c92bc61fb27de3f8558712bae6 # Parent 0b7289fc81a8965c8376d69f0b0d43ff37e76de0 Device: rename device_type_from_classname to res_type_from_device_classname for consistency with the other providers. Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r 0b7289fc81a8 -r dc2deb288f00 src/Virt_Device.c --- a/src/Virt_Device.c Thu Mar 06 13:28:05 2008 +0100 +++ b/src/Virt_Device.c Thu Mar 06 13:28:06 2008 +0100 @@ -268,7 +268,7 @@ static CMPIInstance *device_instance(con return instance; } -uint16_t device_type_from_classname(const char *classname) +uint16_t res_type_from_device_classname(const char *classname) { if (strstr(classname, "NetworkPort")) return CIM_RES_TYPE_NET; @@ -381,7 +381,7 @@ static CMPIStatus return_enum_devices(co inst_list_init(&list); s = enum_devices(_BROKER, reference, NULL, - device_type_from_classname(CLASSNAME(reference)), + res_type_from_device_classname(CLASSNAME(reference)), &list); if (s.rc != CMPI_RC_OK) goto out; @@ -525,7 +525,7 @@ CMPIStatus get_device_by_ref(const CMPIB s = get_device_by_name(broker, reference, name, - device_type_from_classname(CLASSNAME(reference)), + res_type_from_device_classname(CLASSNAME(reference)), &inst); if (s.rc != CMPI_RC_OK) goto out; diff -r 0b7289fc81a8 -r dc2deb288f00 src/Virt_Device.h --- a/src/Virt_Device.h Thu Mar 06 13:28:05 2008 +0100 +++ b/src/Virt_Device.h Thu Mar 06 13:28:06 2008 +0100 @@ -69,7 +69,7 @@ CMPIStatus get_device_by_name(const CMPI const uint16_t type, CMPIInstance **_inst); -uint16_t device_type_from_classname(const char *classname); +uint16_t res_type_from_device_classname(const char *classname); #endif

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1204806486 -3600 # Node ID 2e10c9124c322ff48c740db177a63a49eadf7164 # Parent dc2deb288f0077c92bc61fb27de3f8558712bae6 SDS: adopt renamed Device function Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r dc2deb288f00 -r 2e10c9124c32 src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Thu Mar 06 13:28:06 2008 +0100 +++ b/src/Virt_SettingsDefineState.c Thu Mar 06 13:28:06 2008 +0100 @@ -64,7 +64,7 @@ static CMPIStatus dev_to_rasd(const CMPI s = get_rasd_by_name(_BROKER, ref, name, - device_type_from_classname(CLASSNAME(ref)), + res_type_from_device_classname(CLASSNAME(ref)), NULL, &inst); if (s.rc != CMPI_RC_OK)

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1204806487 -3600 # Node ID 151ba048e3353023aff00c63f23e34abdecd64d8 # Parent 2e10c9124c322ff48c740db177a63a49eadf7164 EAFP: adopt renamed Device function Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r 2e10c9124c32 -r 151ba048e335 src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Thu Mar 06 13:28:06 2008 +0100 +++ b/src/Virt_ElementAllocatedFromPool.c Thu Mar 06 13:28:07 2008 +0100 @@ -40,24 +40,6 @@ const static CMPIBroker *_BROKER; -static uint16_t class_to_type(const CMPIObjectPath *ref) -{ - uint16_t type; - - if (CMClassPathIsA(_BROKER, ref, "CIM_LogicalDisk", NULL)) - type = CIM_RES_TYPE_DISK; - else if (CMClassPathIsA(_BROKER, ref, "CIM_NetworkPort", NULL)) - type = CIM_RES_TYPE_NET; - else if (CMClassPathIsA(_BROKER, ref, "CIM_Memory", NULL)) - type = CIM_RES_TYPE_MEM; - else if (CMClassPathIsA(_BROKER, ref, "CIM_Processor", NULL)) - type = CIM_RES_TYPE_PROC; - else - type = CIM_RES_TYPE_UNKNOWN; - - return type; -} - static CMPIStatus vdev_to_pool(const CMPIObjectPath *ref, struct std_assoc_info *info, struct inst_list *list) @@ -76,7 +58,7 @@ static CMPIStatus vdev_to_pool(const CMP if (s.rc != CMPI_RC_OK) goto out; - type = class_to_type(ref); + type = res_type_from_device_classname(CLASSNAME(ref)); if (type == CIM_RES_TYPE_UNKNOWN) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED,
participants (1)
-
Heidi Eckhart