It's about to become multi-purpose and having AddressProperties and
AddressValues static is problematic.

Signed-off-by: John Ferlan <jfer...@redhat.com>
---
 src/Virt_RASD.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/Virt_RASD.c b/src/Virt_RASD.c
index f75027e..249e6e5 100644
--- a/src/Virt_RASD.c
+++ b/src/Virt_RASD.c
@@ -289,10 +289,12 @@ static bool get_vol_size(const CMPIBroker *broker,
 }
 #endif
 
-static CMPIStatus set_rasd_device_address(const CMPIBroker *broker,
+static CMPIStatus set_rasd_property_value(const CMPIBroker *broker,
                                           const CMPIObjectPath *ref,
                                           const struct device_address *addr,
-                                          CMPIInstance *inst)
+                                          CMPIInstance *inst,
+                                          const char *property_name,
+                                          const char *property_value)
 {
         int i;
         CMPIArray *arr_key;
@@ -338,11 +340,11 @@ static CMPIStatus set_rasd_device_address(const 
CMPIBroker *broker,
                                     CMPI_string);
         }
 
-        CMSetProperty(inst, "AddressProperties",
+        CMSetProperty(inst, property_name,
                       (CMPIValue *)&arr_key,
                       CMPI_stringA);
 
-        CMSetProperty(inst, "AddressValues",
+        CMSetProperty(inst, property_value,
                       (CMPIValue *)&arr_value,
                       CMPI_stringA);
 
@@ -489,10 +491,12 @@ static CMPIStatus set_disk_rasd_params(const CMPIBroker 
*broker,
                               CMPI_boolean);
 
         if (dev->dev.disk.address.ct > 0)
-                set_rasd_device_address(broker,
+                set_rasd_property_value(broker,
                                         ref,
                                         &dev->dev.disk.address,
-                                        inst);
+                                        inst,
+                                        "AddressProperties",
+                                        "AddressValues");
 
         virStoragePoolFree(pool);
         virStorageVolFree(vol);
@@ -658,10 +662,12 @@ static CMPIStatus set_net_rasd_params(const CMPIBroker 
*broker,
                               CMPI_chars);
 
         if (dev->dev.net.address.ct > 0)
-                set_rasd_device_address(broker,
+                set_rasd_property_value(broker,
                                         ref,
                                         &dev->dev.net.address,
-                                        inst);
+                                        inst,
+                                        "AddressProperties",
+                                        "AddressValues");
 
 #if LIBVIR_VERSION_NUMBER < 9000
 out:
-- 
1.8.5.3

_______________________________________________
Libvirt-cim mailing list
Libvirt-cim@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim

Reply via email to