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

Re: [libvirt] [PATCHv8 15/17] qemu: Refactor qemuDomainGetStatsCpu




On 11/12/18 8:31 AM, Wang Huaqiang wrote:
> Refactoring qemuDomainGetStatsCpu, make it possible to add
> more CPU statistics.
> 
> Signed-off-by: Wang Huaqiang <huaqiang wang intel com>
> ---
>  src/qemu/qemu_driver.c | 21 ++++++++++++++++-----
>  1 file changed, 16 insertions(+), 5 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 09e04b8..89d46ee 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -19699,11 +19699,9 @@ typedef enum {
>  
>  
>  static int
> -qemuDomainGetStatsCpu(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
> -                      virDomainObjPtr dom,
> -                      virDomainStatsRecordPtr record,
> -                      int *maxparams,
> -                      unsigned int privflags ATTRIBUTE_UNUSED)
> +qemuDomainGetStatsCpuCgroup(virDomainObjPtr dom,
> +                            virDomainStatsRecordPtr record,
> +                            int *maxparams)
>  {
>      qemuDomainObjPrivatePtr priv = dom->privateData;
>      unsigned long long cpu_time = 0;
> @@ -19739,6 +19737,19 @@ qemuDomainGetStatsCpu(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
>      return 0;
>  }
>  
> +
> +static int
> +qemuDomainGetStatsCpu(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
> +                      virDomainObjPtr dom,
> +                      virDomainStatsRecordPtr record,
> +                      int *maxparams,
> +                      unsigned int privflags ATTRIBUTE_UNUSED)
> +{
> +    if (qemuDomainGetStatsCpuCgroup(dom, record, maxparams) < 0)
> +        return -1;

This should just be:

    return qemuDomainGetStatsCpuCgroup(dom, record, maxparams);

yes, causes a merge conflict in next patch, but that one at least has
the return 0 this one would have needed...

Reviewed-by: John Ferlan <jferlan redhat com>

John


> +}
> +
> +
>  static int
>  qemuDomainGetStatsBalloon(virQEMUDriverPtr driver,
>                            virDomainObjPtr dom,
> 


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