[PATCH] Change VirtualQuantity to uint64 in all sample RASDs

# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1210264590 25200 # Node ID c2465f3f0a2472a45f90707ce9653ad2c59bb50b # Parent 1eef845c77d096d65b256384423b93cda19fb8db Change VirtualQuantity to uint64 in all sample RASDs Signed-off-by: Dan Smith <danms@us.ibm.com> diff -r 1eef845c77d0 -r c2465f3f0a24 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Thu May 08 09:23:56 2008 -0700 +++ b/src/Virt_SettingsDefineCapabilities.c Thu May 08 09:36:30 2008 -0700 @@ -403,13 +403,13 @@ static struct sdc_rasd_prop *proc_min(co CMPIStatus *s) { bool ret; - uint16_t num_procs = 1; + uint64_t num_procs = 1; struct sdc_rasd_prop *rasd = NULL; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Minimum", CMPI_chars}, {"AllocationUnits", (CMPIValue *)"Processors", CMPI_chars}, - {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint16}, + {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint64}, PROP_END }; @@ -428,7 +428,7 @@ static struct sdc_rasd_prop *proc_max(co { bool ret; virConnectPtr conn; - uint16_t num_procs = 0; + uint64_t num_procs = 0; struct sdc_rasd_prop *rasd = NULL; CU_DEBUG("In proc_max()"); @@ -447,7 +447,7 @@ static struct sdc_rasd_prop *proc_max(co struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, {"AllocationUnits", (CMPIValue *)"Processors", CMPI_chars}, - {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint16}, + {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint64}, PROP_END }; @@ -466,13 +466,13 @@ static struct sdc_rasd_prop *proc_def(co CMPIStatus *s) { bool ret; - uint16_t num_procs = 1; + uint64_t num_procs = 1; struct sdc_rasd_prop *rasd = NULL; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, {"AllocationUnits", (CMPIValue *)"Processors", CMPI_chars}, - {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint16}, + {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint64}, PROP_END }; @@ -490,13 +490,13 @@ static struct sdc_rasd_prop *proc_inc(co CMPIStatus *s) { bool ret; - uint16_t num_procs = 1; + uint64_t num_procs = 1; struct sdc_rasd_prop *rasd = NULL; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, {"AllocationUnits", (CMPIValue *)"Processors", CMPI_chars}, - {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint16}, + {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint64}, PROP_END }; @@ -514,38 +514,38 @@ static struct sdc_rasd_prop *net_min(con CMPIStatus *s) { bool ret; - uint16_t num_nics = 0; + uint64_t num_nics = 0; struct sdc_rasd_prop *rasd = NULL; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Minimum", CMPI_chars}, - {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, - PROP_END - }; - - ret = dup_rasd_prop_list(tmp, &rasd); - if (!ret) { - cu_statusf(_BROKER, s, - CMPI_RC_ERR_FAILED, - "Could not copy RASD"); - } - - return rasd; -} - -static uint16_t net_max_kvm(const CMPIObjectPath *ref, + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint64}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD"); + } + + return rasd; +} + +static uint64_t net_max_kvm(const CMPIObjectPath *ref, CMPIStatus *s) { /* This appears to not require anything dynamic. */ return KVM_MAX_NICS; } -static uint16_t net_max_xen(const CMPIObjectPath *ref, +static uint64_t net_max_xen(const CMPIObjectPath *ref, CMPIStatus *s) { int rc; virConnectPtr conn; unsigned long version; - uint16_t num_nics = -1; + uint64_t num_nics = -1; conn = connect_by_classname(_BROKER, CLASSNAME(ref), s); if (s->rc != CMPI_RC_OK) { @@ -579,7 +579,7 @@ static struct sdc_rasd_prop *net_max(con { bool ret; char *prefix; - uint16_t num_nics; + uint64_t num_nics; struct sdc_rasd_prop *rasd = NULL; prefix = class_prefix_name(CLASSNAME(ref)); @@ -611,7 +611,7 @@ static struct sdc_rasd_prop *net_max(con struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, - {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint64}, PROP_END }; @@ -630,11 +630,11 @@ static struct sdc_rasd_prop *net_def(con CMPIStatus *s) { bool ret; - uint16_t num_nics = 1; + uint64_t num_nics = 1; struct sdc_rasd_prop *rasd = NULL; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, - {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint64}, PROP_END }; @@ -652,12 +652,12 @@ static struct sdc_rasd_prop *net_inc(con CMPIStatus *s) { bool ret; - uint16_t num_nics = 1; + uint64_t num_nics = 1; struct sdc_rasd_prop *rasd = NULL; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, - {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint64}, PROP_END }; @@ -675,13 +675,13 @@ static struct sdc_rasd_prop *disk_min(co CMPIStatus *s) { bool ret; - uint16_t disk_size = SDC_DISK_MIN; + uint64_t disk_size = SDC_DISK_MIN; struct sdc_rasd_prop *rasd = NULL; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Minimum", CMPI_chars}, {"AllocationQuantity", (CMPIValue *)"MegaBytes", CMPI_chars}, - {"VirtualQuantity", (CMPIValue *)&disk_size, CMPI_uint16}, + {"VirtualQuantity", (CMPIValue *)&disk_size, CMPI_uint64}, PROP_END }; @@ -701,7 +701,7 @@ static struct sdc_rasd_prop *disk_max(co bool ret; const char *inst_id; CMPIrc prop_ret; - uint16_t free_space; + uint64_t free_space; uint64_t free_64; virConnectPtr conn; CMPIInstance *pool_inst; @@ -737,11 +737,11 @@ static struct sdc_rasd_prop *disk_max(co } CU_DEBUG("Got capacity from pool_inst: %lld", free_64); - free_space = (uint16_t)free_64; + free_space = free_64; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, {"AllocationQuantity", (CMPIValue *)"MegaBytes", CMPI_chars}, - {"VirtualQuantity", (CMPIValue *)&free_space, CMPI_uint16}, + {"VirtualQuantity", (CMPIValue *)&free_space, CMPI_uint64}, PROP_END }; @@ -760,13 +760,13 @@ static struct sdc_rasd_prop *disk_def(co CMPIStatus *s) { bool ret; - uint16_t disk_size = SDC_DISK_DEF; + uint64_t disk_size = SDC_DISK_DEF; struct sdc_rasd_prop *rasd = NULL; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, {"AllocationQuantity", (CMPIValue *)"MegaBytes", CMPI_chars}, - {"VirtualQuantity", (CMPIValue *)&disk_size, CMPI_uint16}, + {"VirtualQuantity", (CMPIValue *)&disk_size, CMPI_uint64}, PROP_END }; @@ -784,13 +784,13 @@ static struct sdc_rasd_prop *disk_inc(co CMPIStatus *s) { bool ret; - uint16_t disk_size = SDC_DISK_INC; + uint64_t disk_size = SDC_DISK_INC; struct sdc_rasd_prop *rasd = NULL; struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, {"AllocationQuantity", (CMPIValue *)"MegaBytes", CMPI_chars}, - {"VirtualQuantity", (CMPIValue *)&disk_size, CMPI_uint16}, + {"VirtualQuantity", (CMPIValue *)&disk_size, CMPI_uint64}, PROP_END };

diff -r 1eef845c77d0 -r c2465f3f0a24 src/Virt_SettingsDefineCapabilities.c
@@ -701,7 +701,7 @@ static struct sdc_rasd_prop *disk_max(co bool ret; const char *inst_id; CMPIrc prop_ret; - uint16_t free_space; + uint64_t free_space; uint64_t free_64; virConnectPtr conn; CMPIInstance *pool_inst; @@ -737,11 +737,11 @@ static struct sdc_rasd_prop *disk_max(co } CU_DEBUG("Got capacity from pool_inst: %lld", free_64);
- free_space = (uint16_t)free_64; + free_space = free_64;
I don't think we need both free_space and free_64 anymore. free_64 is used to get the value from the Capacity attribute. The only other time it's used is when free_space is assigned its value. -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

KR> I don't think we need both free_space and free_64 anymore. KR> free_64 is used to get the value from the Capacity attribute. The KR> only other time it's used is when free_space is assigned its KR> value. Yep, good call. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com
participants (2)
-
Dan Smith
-
Kaitlin Rupert