Re: [PATCH] bhyve: report cpuTime in bhyveDomainGetInfo

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

 



  Ján Tomko wrote:

> On 05/04/2014 03:45 PM, Roman Bogorodskiy wrote:
> >   Ján Tomko wrote:
> > 
> >> On 05/01/2014 02:11 PM, Roman Bogorodskiy wrote:
> >>> Add a helper function virBhyveGetDomainTotalCpuStats() to
> >>> obtain process CPU time using kvm (kernel memory interface)
> >>> and use it to set cpuTime field of the virDomainInfo struct in
> >>> bhyveDomainGetInfo().
> >>> ---
> >>>  configure.ac              |  7 +++++++
> >>>  src/bhyve/bhyve_driver.c  |  9 +++++++++
> >>>  src/bhyve/bhyve_process.c | 40 ++++++++++++++++++++++++++++++++++++++++
> >>>  src/bhyve/bhyve_process.h |  3 +++
> >>>  4 files changed, 59 insertions(+)
> >>>
> >>
> >>> --- a/src/bhyve/bhyve_driver.c
> >>> +++ b/src/bhyve/bhyve_driver.c
> >>> @@ -268,6 +268,15 @@ bhyveDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
> >>>      if (virDomainGetInfoEnsureACL(domain->conn, vm->def) < 0)
> >>>          goto cleanup;
> >>>  
> >>> +    if (virDomainObjIsActive(vm)) {
> >>> +        if (virBhyveGetDomainTotalCpuStats(vm, &(info->cpuTime)) < 0) {
> >>> +            virReportError(VIR_ERR_OPERATION_FAILED,
> >>> +                           "%s", _("Cannot read cputime for domain"));
> >>
> >> This will overwrite the error set by virBhyveGetDomainTotalCpuStats.
> > 
> > Just to make sure: you mean I need to just drop virReportError here and
> > just rely on error reporting by virBhyveGetDomainTotalCpuStats()?
> > 
> 
> Yes, I think reporting a more specific error message inside the function is
> better.

Thanks; pushed with these fixes.

Roman Bogorodskiy

Attachment: pgphylVnX_5sr.pgp
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]