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

Re: [libvirt] [PATCHv3 4/8] Implement main entries of virDomain{G, S}etNumaParameters



On Fri, Dec 16, 2011 at 09:22:37AM -0700, Eric Blake wrote:
> On 12/15/2011 03:50 AM, Hu Tao wrote:
> > ---
> >  src/libvirt.c |  113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 files changed, 113 insertions(+), 0 deletions(-)
> 
> I've reviewed 1-4, and the first three look fine; however, I'm going to
> squash 3 and 4 into a single patch (it's easier to see the documentation
> in libvirt.c alongside the entry points added in libvirt.h in the same
> commit).  Also,

OK with merging 3 and 4.

> 
> > +/**
> > + * virDomainGetNumaParameters:
> > + * @domain: pointer to domain object
> > + * @params: pointer to numa parameter object
> > + *          (return value, allocated by the caller)
> > + * @nparams: pointer to number of numa parameters
> > + * @flags: one of virDomainModificationImpact
> > + *
> > + * This function may require privileged access to the hypervisor. This function
> > + * expects the caller to allocate the @params.
> 
> You didn't document how to set @params and @nparams.  So I squashed in:

Thanks.

> 
> diff --git i/src/libvirt.c w/src/libvirt.c
> index e61d91e..574be16 100644
> --- i/src/libvirt.c
> +++ w/src/libvirt.c
> @@ -3772,7 +3772,7 @@ error:
>   * virDomainSetNumaParameters:
>   * @domain: pointer to domain object
>   * @params: pointer to numa parameter objects
> - * @nparams: number of numa parameter (this value can be the same or
> + * @nparams: number of numa parameters (this value can be the same or
>   *          less than the number of parameters supported)
>   * @flags: bitwise-OR of virDomainModificationImpact
>   *
> @@ -3781,9 +3781,10 @@ error:
>   *
>   * Returns -1 in case of error, 0 in case of success.
>   */
> -int     virDomainSetNumaParameters(virDomainPtr domain,
> -                                   virTypedParameterPtr params,
> -                                   int nparams, unsigned int flags)
> +int
> +virDomainSetNumaParameters(virDomainPtr domain,
> +                           virTypedParameterPtr params,
> +                           int nparams, unsigned int flags)
>  {
>      virConnectPtr conn;
> 
> @@ -3812,7 +3813,8 @@ int     virDomainSetNumaParameters(virDomainPtr
> domain,
> 
>      if (conn->driver->domainSetNumaParameters) {
>          int ret;
> -        ret = conn->driver->domainSetNumaParameters (domain, params,
> nparams, flags);
> +        ret = conn->driver->domainSetNumaParameters(domain, params,
> nparams,
> +                                                    flags);
>          if (ret < 0)
>              goto error;
>          return ret;
> @@ -3831,7 +3833,20 @@ error:
>   * @params: pointer to numa parameter object
>   *          (return value, allocated by the caller)
>   * @nparams: pointer to number of numa parameters
> - * @flags: one of virDomainModificationImpact
> + * @flags: bitwise-OR of virDomainModificationImpact and
> virTypedParameterFlags
> + *
> + * Get all numa parameters.  On input, @nparams gives the size of the
> + * @params array; on output, @nparams gives how many slots were filled
> + * with parameter information, which might be less but will not exceed
> + * the input value.
> + *
> + * As a special case, calling with @params as NULL and @nparams as 0 on
> + * input will cause @nparams on output to contain the number of parameters
> + * supported by the hypervisor. The caller should then allocate @params
> + * array, i.e. (sizeof(@virTypedParameter) * @nparams) bytes and call
> the API
> + * again.
> + *
> + * See virDomainGetMemoryParameters() for an equivalent usage example.
>   *
>   * This function may require privileged access to the hypervisor. This
> function
>   * expects the caller to allocate the @params.
> @@ -3869,7 +3884,8 @@ virDomainGetNumaParameters(virDomainPtr domain,
> 
>      if (conn->driver->domainGetNumaParameters) {
>          int ret;
> -        ret = conn->driver->domainGetNumaParameters (domain, params,
> nparams, flags);
> +        ret = conn->driver->domainGetNumaParameters(domain, params,
> nparams,
> +                                                    flags);
>          if (ret < 0)
>              goto error;
>          return ret;
> 
> -- 
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
> 



-- 
Thanks,
Hu Tao


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