
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1212516442 25200 # Node ID bad698c7ab90ec47167f078c4bbf96648351269e # Parent 0c8d4baf3ee1f6eb96f7d1d49276fa6cc44c4685 Return an error for type processor in AddResource and RemoveResource. A user should use ModifyResource to change the number of processors. Also fix a warning caused by this change. Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 0c8d4baf3ee1 -r bad698c7ab90 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Fri May 30 06:57:03 2008 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Tue Jun 03 11:07:22 2008 -0700 @@ -979,7 +979,7 @@ CMPIObjectPath *op; struct virt_device **_list; struct virt_device *list; - int *count; + int *count = NULL; int i; op = CMGetObjectPath(rasd, &s); @@ -987,7 +987,8 @@ goto out; _list = find_list(dominfo, type, &count); - if ((type == CIM_RES_TYPE_MEM) || (_list != NULL)) + if ((type == CIM_RES_TYPE_MEM) || (type == CIM_RES_TYPE_PROC) || + (_list != NULL)) list = *_list; else { cu_statusf(_BROKER, &s, @@ -1028,14 +1029,15 @@ struct virt_device **_list; struct virt_device *list; struct virt_device *dev; - int *count; + int *count = NULL; op = CMGetObjectPath(rasd, &s); if ((op == NULL) || (s.rc != CMPI_RC_OK)) goto out; _list = find_list(dominfo, type, &count); - if ((type == CIM_RES_TYPE_MEM) || (_list == NULL)) { + if ((type == CIM_RES_TYPE_MEM) || (type == CIM_RES_TYPE_PROC) || + (_list != NULL)) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Cannot add resources of type %" PRIu16, type);