Skip to content

enable blockstats for network disks#296

Merged
retspen merged 1 commit intoretspen:masterfrom
EmbeddedAndroid:master
Apr 29, 2014
Merged

enable blockstats for network disks#296
retspen merged 1 commit intoretspen:masterfrom
EmbeddedAndroid:master

Conversation

@EmbeddedAndroid
Copy link
Copy Markdown
Contributor

Reading through the libvirt API I found that it is possible to retrieve block stats from network disks.

'dev_file' is assumed to be the path to the virtual hard disk which is gathered from the source element. However, network disks do not have a 'dev' or 'file' attribute as documented here:

http://libvirt.org/formatdomain.html#elementsDisks

Libvirt:blockStats will not only accept a path to the virtual disk, but also a target block device such as 'vdz'. This change set detects a network disk, and set dev_file = dev_bus in only that case.

I've tested this change locally, and disk usage is shown for both virtual machines with physical virtual hard disks, and network (rbd) disks! It would be nice if anyone else using a network disk to test if this and validate that is working for them as well.

Here is a picture of disk usage reporting for a network disk:

screen shot 2014-04-28 at 5 54 44 pm

retspen added a commit that referenced this pull request Apr 29, 2014
enable blockstats for network disks
@retspen retspen merged commit 9247043 into retspen:master Apr 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants