Re: [PATCHv6 01/11] qemu: bulk stats: extend internal collection API

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

 



On 09/15/2014 09:42 AM, Peter Krempa wrote:
> From: Francesco Romani <fromani@xxxxxxxxxx>
> 
> Future patches which will implement more bulk stats groups for QEMU will
> need to access the connection object.
> 
> To accomodate that, a few changes are needed:

s/accomodate/accommodate/

> 
> * enrich internal prototype to pass qemu driver object
> 
> * add per-group flag to mark if one collector needs monitor access or not
> 
> * If at least one collector of the requested stats needs monitor access
>   we must start a query job for each domain.  The specific collectors
>   will run nested monitor jobs inside that.
> 
> * If the job can't be acquired we pass flags to the collector so
>   specific collectors that need monitor access can be skipped in order
>   to gather as much data as is possible.
> 
> Signed-off-by: Francesco Romani <fromani@xxxxxxxxxx>
> Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
> ---
> 
> Notes:
>     Version 6:
>     - renamed HAVE_MONITOR to HAVE_JOB
> 
>  src/qemu/qemu_driver.c | 63 +++++++++++++++++++++++++++++++++++++++++++-------
>  1 file changed, 55 insertions(+), 8 deletions(-)
> 

> +static bool
> +qemuDomainGetStatsNeedMonitor(unsigned int stats)
> +{
> +    size_t i;
> +
> +    for (i = 0; qemuDomainGetStatsWorkers[i].func; i++)
> +        if (stats & qemuDomainGetStatsWorkers[i].stats)
> +            if (qemuDomainGetStatsWorkers[i].monitor)

Could combine two 'if' into one with &&, but as-is works as well.

> @@ -17525,12 +17557,22 @@ qemuConnectGetAllDomainStats(virConnectPtr conn,
>              !virConnectGetAllDomainStatsCheckACL(conn, dom->def))
>              continue;
> 
> -        if (qemuDomainGetStats(conn, dom, stats, &tmp, flags) < 0)
> -            goto cleanup;
> +        if (HAVE_JOB(domflags) &&
> +             qemuDomainObjBeginJob(driver, dom, QEMU_JOB_QUERY) < 0)

Indentation is off.

ACK with nit fixed.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital 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]