]> xenbits.xensource.com Git - libvirt.git/commit
getstats: add block.n.path stat
authorEric Blake <eblake@redhat.com>
Tue, 25 Nov 2014 00:12:30 +0000 (17:12 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 8 Dec 2014 18:58:39 +0000 (11:58 -0700)
commit7b499262cb6d2bc2361bc4cd3742c0cea331666f
tree70c597a78101d875cfb6e1bc4a5f37a2135d98f0
parent56b21dfe0c12867fa1dc3715145a61017e6928f1
getstats: add block.n.path stat

I'm about to make block stats optionally more complex to cover
backing chains, where block.count will no longer equal the number
of <disks> for a domain.  For these reasons, it is nicer if the
statistics output includes the source path (for local files).
This patch doesn't add anything for network disks, although we
may decide to add that later.

With this patch, I now see the following for the same domain as
in the previous patch (one qcow2 file, and an empty cdrom drive):
$ virsh domstats --block foo
Domain: 'foo'
  block.count=2
  block.0.name=hda
  block.0.path=/var/lib/libvirt/images/foo.qcow2
  block.1.name=hdc

* src/libvirt-domain.c (virConnectGetAllDomainStats): Document
new field.
* tools/virsh.pod (domstats): Document new field.
* src/qemu/qemu_driver.c (qemuDomainGetStatsBlock): Return the new
stat for local files/block devices.
(QEMU_ADD_NAME_PARAM): Add parameter.
(qemuDomainGetStatsInterface): Update caller.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/libvirt-domain.c
src/qemu/qemu_driver.c
tools/virsh.pod