[Libvirt-cim] [PATCH 4 of 6] Add NetworkPort functionality to SettingsDefineCapabilities. All static, max may become dynamic

Jay Gagnon grendel at linux.vnet.ibm.com
Fri Nov 9 15:39:42 UTC 2007


Dan Smith wrote:
> 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?
>
>   
I agree that this should probably be made intelligent in the future, but
as I said with regards to the disk patch, I don't necessarily see the
point to making this a defined constant unless we need to use it
elsewhere or we actually add a hardcoded value for KVM.  As it is right
now, the value is only ever assigned in that initialization line and
only ever read four lines later, and its use seems clear enough that a
named constant won't be adding any clarity.  Not a huge deal, and, "Yea,
that's a good point.  Make it a define," is a fine response here, but
that's my opinion on the matter.


-- 

-Jay




More information about the Libvirt-cim mailing list