[Libvirt-cim] [PATCH] Change DevicePath to DevicePaths in SettingsDefineCapabilities
Richard Maciel
rmaciel at linux.vnet.ibm.com
Mon Jul 6 18:43:02 UTC 2009
+1
Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert <karupert at us.ibm.com>
> # Date 1246490192 25200
> # Node ID 7bbb36258bf14bcf5ae40ad54356ac977620b569
> # Parent 4ea22198d1848b0097e81268dcedc940f2fb9be5
> Change DevicePath to DevicePaths in SettingsDefineCapabilities
>
> Due to the logical pool changes, DevicePath changed to DevicePaths. It's now
> also an array type attribute.
>
> Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
>
> diff -r 4ea22198d184 -r 7bbb36258bf1 src/Virt_SettingsDefineCapabilities.c
> --- a/src/Virt_SettingsDefineCapabilities.c Wed Jul 01 13:39:52 2009 -0700
> +++ b/src/Virt_SettingsDefineCapabilities.c Wed Jul 01 16:16:32 2009 -0700
> @@ -1256,6 +1256,7 @@
> {
> const char *id;
> CMPIInstance *inst;
> + CMPIArray *array;
> CMPIStatus s = {CMPI_RC_OK, NULL};
> const char *path = "/dev/null";
> int type[7] = {DISK_POOL_DIR,
> @@ -1332,9 +1333,30 @@
> break;
> }
>
> - if (dev_path != NULL)
> - CMSetProperty(inst, "DevicePath",
> - (CMPIValue *)dev_path, CMPI_chars);
> + if (dev_path != NULL) {
> + CMPIString *str = NULL;
> +
> + array = CMNewArray(_BROKER, 1, CMPI_string, &s);
> + if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(array))) {
> + cu_statusf(_BROKER, &s,
> + CMPI_RC_ERR_FAILED,
> + "Unable to create new array");
> + goto out;
> + }
> +
> + str = CMNewString(_BROKER, dev_path, &s);
> + if ((s.rc = CMPI_RC_OK) || (CMIsNullObject(str))) {
> + cu_statusf(_BROKER, &s,
> + CMPI_RC_ERR_FAILED,
> + "Unable to create new string");
> + goto out;
> + }
> +
> + CMSetArrayElementAt(array, 0, &str, CMPI_string);
> +
> + CMSetProperty(inst, "DevicePaths",
> + (CMPIValue *)&array, CMPI_stringA);
> + }
>
> if (host != NULL)
> CMSetProperty(inst, "Host",
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
--
Richard Maciel, MSc
IBM Linux Technology Center
rmaciel at linux.vnet.ibm.com
More information about the Libvirt-cim
mailing list