]> xenbits.xensource.com Git - libvirt.git/commit
libxl: implement virDomainBlockStats
authorJoao Martins <joao.m.martins@oracle.com>
Mon, 25 Jul 2016 23:45:14 +0000 (00:45 +0100)
committerJim Fehlig <jfehlig@suse.com>
Tue, 26 Jul 2016 21:33:30 +0000 (15:33 -0600)
commiteee7bd4ecb5a3e83ed47cc89bf0dc4866b4858af
tree461c63b43ecd749ac5de46cc96379c9bf91d3e8a
parente975fd2d425275afaf0206e9d5f0b897ebd3fa5a
libxl: implement virDomainBlockStats

Introduce initial support for domainBlockStats API call that
allow us to query block device statistics. OpenStack nova
uses this API call to query block statistics, alongside
virDomainMemoryStats and virDomainInterfaceStats.  Note that
this patch only introduces it for VBD for starters. QDisk
would come in a separate patch series.

A new statistics data structure is introduced to fit common
statistics among others specific to the underlying block
backends. For the VBD statistics on linux these are exported
via sysfs on the path:

"/sys/bus/xen-backend/devices/vbd-<domid>-<devid>/statistics"

To calculate the block devno libxlDiskPathToID is introduced.
Each backend implements its own function to extract statistics,
allowing support for multiple backends and different platforms.

VBD stats are exposed in reqs and number of sectors from
blkback, and it's up to us to convert it to sector sizes.
The sector size is gathered through xenstore in the device
backend entry "physical-sector-size".

BlockStatsFlags variant is also implemented which has the
added benefit of getting the number of flush requests.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
src/libxl/libxl_driver.c