JG> + uint16_t num_nics = 6;
JG> + struct sdc_rasd_prop *rasd = NULL;
JG> +
JG> + struct sdc_rasd_prop tmp[] = {
JG> + {"InstanceID", (CMPIValue *)"Maximum",
CMPI_chars},
JG> + {"VirtualQuantity", (CMPIValue *)&num_nics,
CMPI_uint16},
JG> + PROP_END
JG> + };
The maximum NIC count is probably different for KVM and Xen, and I
imagine this function should be intelligent in the future. Could we
at least pull the '6' out to a constant like XEN_MAX_VIF or something?
JG> +static struct sdc_rasd_prop *net_def(const CMPIObjectPath *ref,
JG> + CMPIStatus *s)
JG> +{
JG> + bool ret;
JG> + uint16_t num_nics = 1;
JG> + struct sdc_rasd_prop *rasd = NULL;
JG> +
JG> + struct sdc_rasd_prop tmp[] = {
JG> + {"InstanceID", (CMPIValue *)"Default",
CMPI_chars},
JG> + {"VirtualQuantity", (CMPIValue *)&num_nics,
CMPI_uint16},
JG> + PROP_END
JG> + };
JG> +
JG> + ret = dup_rasd_prop_list(tmp, &rasd);
JG> + if (ret)
JG> + return rasd;
JG> + else
JG> + return NULL;
JG> +}
JG> +
JG> +static struct sdc_rasd_prop *net_inc(const CMPIObjectPath *ref,
JG> + CMPIStatus *s)
JG> +{
JG> + bool ret;
JG> + uint16_t num_nics = 1;
JG> + struct sdc_rasd_prop *rasd = NULL;
JG> +
JG> + struct sdc_rasd_prop tmp[] = {
JG> + {"InstanceID", (CMPIValue *)"Increment",
CMPI_chars},
JG> + {"VirtualQuantity", (CMPIValue *)&num_nics,
CMPI_uint16},
JG> + PROP_END
JG> + };
JG> +
JG> + ret = dup_rasd_prop_list(tmp, &rasd);
JG> + if (ret)
JG> + return rasd;
JG> + else
JG> + return NULL;
JG> +}
I think "default" and "increment" in the network case are probably
safe to leave hardcoded to '1' and buried :)
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms(a)us.ibm.com