[libvirt] [PATCH] bhyve: implement domainGetCPUStats

Roman Bogorodskiy bogorodskiy at gmail.com
Tue Apr 22 18:02:04 UTC 2014


  Roman Bogorodskiy wrote:

> For per CPU stats, implement virBhyveGetDomainPercpuStats() that
> uses bhyvectl tool to obtain the guest's vcpu stats.
> 
> For total CPU stats, add virBhyveGetDomainTotalCpuStats() that
> gets the hypervisor process CPU stats using kvm (kernel
> memory interface).
> ---
>  configure.ac              |   7 +++
>  src/bhyve/bhyve_driver.c  |  38 +++++++++++++
>  src/bhyve/bhyve_process.c | 136 ++++++++++++++++++++++++++++++++++++++++++++++
>  src/bhyve/bhyve_process.h |  10 ++++
>  4 files changed, 191 insertions(+)
> diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c
> index a557bc5..e1f4324 100644
> --- a/src/bhyve/bhyve_process.c
> +++ b/src/bhyve/bhyve_process.c

...

> +int
> +virBhyveGetDomainTotalCpuStats(virDomainObjPtr vm,
> +                               virTypedParameterPtr params ATTRIBUTE_UNUSED,
> +                               unsigned int nparams)
> +{
> +    struct kinfo_proc* kp;
> +    kvm_t* kd;

Just noticed that it should be:

struct kinfo_proc *kp;
kvm_t *kd;

I will not re-send the patch just because of that and will include the
fix in the next version.

> +    char errbuf[_POSIX2_LINE_MAX];
> +    int nprocs;
> +    int ret = -1;

Roman Bogorodskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140422/bcb72d21/attachment-0001.sig>


More information about the libvir-list mailing list