[PR #296] [MERGED] enable blockstats for network disks #609

Closed
opened 2026-02-27 16:39:52 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/retspen/webvirtmgr/pull/296
Author: @EmbeddedAndroid
Created: 4/29/2014
Status: Merged
Merged: 4/29/2014
Merged by: @retspen

Base: masterHead: master


📝 Commits (1)

  • 4ca0e0e enable blockstats for network disks

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 vrtManager/instance.py (+6 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/retspen/webvirtmgr/pull/296 **Author:** [@EmbeddedAndroid](https://github.com/EmbeddedAndroid) **Created:** 4/29/2014 **Status:** ✅ Merged **Merged:** 4/29/2014 **Merged by:** [@retspen](https://github.com/retspen) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`4ca0e0e`](https://github.com/retspen/webvirtmgr/commit/4ca0e0e70018b2fb56aeab242cde3720b518cabd) enable blockstats for network disks ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `vrtManager/instance.py` (+6 -0) </details> ### 📄 Description 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](https://cloud.githubusercontent.com/assets/1061011/2825057/9cca8392-cf41-11e3-8a14-7d9345e8b497.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 16:39:52 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#609
No description provided.