Bug 1330940 - RFE: virsh: domblkinfo option to output human readable byte values
Summary: RFE: virsh: domblkinfo option to output human readable byte values
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-27 10:53 UTC by Michael Liu
Modified: 2017-05-02 07:43 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-02 07:43:05 UTC
Embargoed:


Attachments (Terms of Use)

Description Michael Liu 2016-04-27 10:53:24 UTC
Version-Release number of selected component (if applicable):
libvirt 1.2.21

virsh domblkinfo 64 vda 
Capacity:       214748364800
Allocation:     494080
Physical:       182910976

  virsh blkdeviotune shows values in raw bytes, which is  difficult to read. it show add a parameter like -h to show the values in megabytes or gigabytes.

Comment 1 Michal Privoznik 2017-05-02 07:43:05 UTC
I've just pushed patch upstream:

commit 4b9af8625a642339526b47eff718fab12c4b7cea
Author:     Julio Faracco <jcfaracco>
AuthorDate: Mon May 1 19:35:55 2017 -0300
Commit:     Michal Privoznik <mprivozn>
CommitDate: Tue May 2 09:36:31 2017 +0200

    virsh-domain-monitor: add human readable output for 'domblkinfo'.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1330940
    
    The virsh command 'domblkinfo' returns the capacity, allocation and phisycal
    size of the devices attached in a domain. Usually, this sizes are very big
    and hard to understand and calculate. This commits introduce a human readable
    support to check the size of each field easilly.
    
    For example, the command before:
    
    virsh # domblkinfo my_domain hda
    Capacity:       21474836480
    Allocation:     14875545600
    Physical:       21474836480
    
    and after this patch:
    
    virsh # domblkinfo my_domain hda --human
    Capacity:       20.000G
    Allocation:     13.900G
    Physical:       20.000G
    
    Signed-off-by: Julio Faracco <jcfaracco>
    Signed-off-by: Michal Privoznik <mprivozn>
    Reviewed-by: Michal Privoznik <mprivozn>


Note You need to log in before you can comment on or make changes to this bug.