os-cmpi-xen
changeset 126:d1dab4776fed
Added support in Xen_VirtualSystemManagementService for specifying VCPU Weight and Limit (cap) in Xen_ProcessorRASD.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
author | Jim Fehlig <jfehlig@novell.com> |
---|---|
date | Wed Jun 13 11:18:11 2007 -0600 (2007-06-13) |
parents | ce72210a88c6 |
children | 152ceecb9f39 |
files | ChangeLog src/Xen_VirtualSystemManagementService.c |
line diff
1.1 --- a/ChangeLog Tue Jun 12 17:44:58 2007 -0600 1.2 +++ b/ChangeLog Wed Jun 13 11:18:11 2007 -0600 1.3 @@ -1,3 +1,15 @@ 1.4 +------------------------------------------------------------------- 1.5 +Tue Jun 12 17:50:28 MDT 2007 - jfehlig@novell.com 1.6 + 1.7 + - Ported Xen_ProcessorSettingData to 'Cmpilr' interface 1.8 + - Changed 'Cmpilr' interface to stop overloading 'res' 1.9 + parameter to get() and modify(). Udpated providers 1.10 + already using the interface. There will be one more 1.11 + round of updates to 'Cmpilr' when we synch with SBLIM 1.12 + cmpilify project. 1.13 + - Added support in Xen_VirtualSystemManagementService for 1.14 + specifying VCPU Weight and Limit (cap) in Xen_ProcessorRASD. 1.15 + 1.16 ------------------------------------------------------------------- 1.17 Fri Jun 8 10:16:45 MDT 2007 - jfehlig@novell.com 1.18
2.1 --- a/src/Xen_VirtualSystemManagementService.c Tue Jun 12 17:44:58 2007 -0600 2.2 +++ b/src/Xen_VirtualSystemManagementService.c Wed Jun 13 11:18:11 2007 -0600 2.3 @@ -1885,21 +1885,35 @@ static int proc_rasd2vmconfig(CMPIInstan 2.4 CMPIData propertyvalue; 2.5 2.6 propertyvalue = CMGetProperty(proc_rasd, "VirtualQuantity", status); 2.7 + /* TODO: 2.8 + * How is vcpus_max represented in RASD? For now use VirtualQuantity. 2.9 + */ 2.10 if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) { 2.11 - /* 2.12 - * TODO: 2.13 - * 1. Handle defaults if processors not specified. 2.14 - * 2. CPU weights and other scheduling parameters? 2.15 - * 3. Handle VM.vcpus_max properly. 0 is not good so 2.16 - * we'll set it to same value as number of vcpus set 2.17 - * in VirtualQuantity for now. 2.18 - */ 2.19 vm_rec->vcpus_at_startup = propertyvalue.value.uint64; 2.20 vm_rec->vcpus_max = propertyvalue.value.uint64; 2.21 - return 1; 2.22 + } 2.23 + else { 2.24 + /* 2.25 + * Default to 1 vcpu if VirtualQuantity not specified. 2.26 + * Allocation capabilities should describe this default behavior. 2.27 + */ 2.28 + vm_rec->vcpus_at_startup = 1; 2.29 + vm_rec->vcpus_max = 1; 2.30 } 2.31 2.32 - return 0; 2.33 + char buf[64]; 2.34 + propertyvalue = CMGetProperty(proc_rasd, "Limit", status); 2.35 + if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) { 2.36 + snprintf(buf, 64, "%lld", propertyvalue.value.uint64); 2.37 + xen_utils_add_to_string_string_map("cap", buf, &(vm_rec->vcpus_params)); 2.38 + } 2.39 + propertyvalue = CMGetProperty(proc_rasd, "Weight", status); 2.40 + if ((status->rc == CMPI_RC_OK) && !CMIsNullValue(propertyvalue)) { 2.41 + snprintf(buf, 64, "%d", propertyvalue.value.uint32); 2.42 + xen_utils_add_to_string_string_map("weight", buf, &(vm_rec->vcpus_params)); 2.43 + } 2.44 + 2.45 + return 1; 2.46 } 2.47 2.48