[libvirt] [PATCH v4 02/13] Adding virDomainSetMemoryParameters and virDomainGetMemoryParameters API

Eric Blake eblake at redhat.com
Tue Oct 12 14:16:11 UTC 2010


On 10/12/2010 08:01 AM, Daniel Veillard wrote:
>
> Seems that params<= 0 or a NULL params are errors in this function
> based on the API description, so I prefer to catch those here and added
>
>      if ((nparams<= 0) || (params == NULL)) {
>          virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
>          goto error;
>      }

Or even one step further, and use annotations to mark the function 
arguments as ATTRIBUTE_NONNULL to get compiler checking of your logic.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list