[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



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 redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]