RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1175276 - Rebuild libvirt-python to pick up the new flag for fetching backing chain statistics
Summary: Rebuild libvirt-python to pick up the new flag for fetching backing chain sta...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt-python
Version: 7.1
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1041569
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-17 12:26 UTC by Jiri Denemark
Modified: 2016-04-26 14:13 UTC (History)
32 users (show)

Fixed In Version: libvirt-python-1.2.8-7.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1041569
Environment:
Last Closed: 2015-03-05 07:57:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0334 0 normal SHIPPED_LIVE new packages: libvirt-python 2015-03-05 12:23:16 UTC

Description Jiri Denemark 2014-12-17 12:26:31 UTC
+++ This bug was initially created as a clone of Bug #1041569 +++

commit 4bffafb2eb076255dbd7e0d96f2b33a4fea0650e
Author: Eric Blake <eblake>
Date:   Tue Nov 25 08:46:49 2014 -0700

    getstats: add new flag for block backing chain
    
    This patch introduces access to allocation information about
    a backing chain of a live domain.  While querying storage
    volumes for read-only disks could provide some of the details,
    we do NOT want to read() a file while qemu is writing it.
    Also, there is one case where we have to rely on qemu: when
    doing a block commit into a backing file, where that file is
    stored in qcow2 format on a host block device, we want to know
    the current highest write offset into that image, in order to
    know if the disk must be resized larger.  qemu-img does not
    (currently) show this information, and none of the earlier
    block APIs were extensible enough to expose it.  But
    virDomainListGetStats is perfect for the job!
    
    We don't need a new group of statistics, as the existing block
    group is sufficient.  On the other hand, as existing libvirt
    releases already report 1:1 mapping of block.count to <disk>
    devices, changing the array size could confuse older clients;
    and even with newer clients, the time and memory taken to
    report additional statistics is not always necessary (backing
    files are generally read-only except for block-commit, so while
    read statistics may change, sizing statistics will not).  So
    the choice here is to add a new flag that only newer callers
    will pass, when they are prepared for the additional information.
    
    This patch introduces the new API, but it will take more
    patches to get it implemented for qemu.
    
    * include/libvirt/libvirt-domain.h
    (VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING): New flag.
    * src/libvirt-domain.c (virConnectGetAllDomainStats): Document it,
    and add a new field when it is in use.
    * tools/virsh-domain-monitor.c (cmdDomstats): Use new flag.
    * tools/virsh.pod (domstats): Document it.
    
    Signed-off-by: Eric Blake <eblake>

added VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING flag for virConnectGetAllDomainStats. We need to rebuild libvirt-python to pick up this new flag.

Version-Release number of selected component (if applicable):

libvirt-1.2.8-11.el7
libvirt-python-1.2.8-6.el7

Steps to Reproduce:
1. python -c "import libvirt; print libvirt.VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING

Expected results:
1073741824

Comment 1 Daniel Berrangé 2014-12-17 14:04:23 UTC
Upstream in

commit 26d6790bab3ed1819f2cfe9003d0d47a686ba675
Author: Daniel P. Berrange <berrange>
Date:   Wed Dec 17 14:00:38 2014 +0000

    Add VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING constant

Comment 2 Daniel Berrangé 2014-12-17 14:11:25 UTC
Of course that last comment was meant for the perl bug, not the python bug. Ignore it :-)

Comment 4 Hu Jianwei 2014-12-24 06:27:40 UTC
Verify as below:

[root@ibm-x3850x5-06 libvirt-1.2.8-11.el7]# rpm -q libvirt libvirt-python
libvirt-1.2.8-11.el7.x86_64
libvirt-python-1.2.8-7.el7.x86_64

[root@ibm-x3850x5-06 libvirt-1.2.8-11.el7]# python
Python 2.7.5 (default, Feb 11 2014, 07:46:25) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> print libvirt.VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING
1073741824
>>> 

Other related testing contents:
[root@ibm-x3850x5-06 libvirt-1.2.8-11.el7]# virsh help domstats
  NAME
    domstats - get statistics about one or multiple domains

  SYNOPSIS
    domstats [--state] [--cpu-total] [--balloon] [--vcpu] [--interface] [--block] [--list-active] [--list-inactive] [--list-persistent] [--list-transient] [--list-running] [--list-paused] [--list-shutoff] [--list-other] [--raw] [--enforce] [--backing] [<domain>]...

  DESCRIPTION
    Gets statistics about one or more (or all) domains

  OPTIONS
    --state          report domain state
    --cpu-total      report domain physical cpu usage
    --balloon        report domain balloon statistics
    --vcpu           report domain virtual cpu information
    --interface      report domain network interface information
    --block          report domain block device statistics
    --list-active    list only active domains
    --list-inactive  list only inactive domains
    --list-persistent  list only persistent domains
    --list-transient  list only transient domains
    --list-running   list only running domains
    --list-paused    list only paused domains
    --list-shutoff   list only shutoff domains
    --list-other     list only domains in other states
    --raw            do not pretty-print the fields
    --enforce        enforce requested stats parameters
    --backing        add backing chain information to block stats           <====New
    <domain>         list of domains to get stats for


[root@ibm-x3850x5-06 libvirt-1.2.8-11.el7]# virsh snapshot-create-as multi --disk-only
Domain snapshot 1419400094 created

[root@ibm-x3850x5-06 libvirt-1.2.8-11.el7]# virsh domstats multi --backing 
Domain: 'multi'
  state.state=1
  state.reason=5
  balloon.current=1048576
  balloon.maximum=1048576
  vcpu.current=1
  vcpu.maximum=1
  vcpu.0.state=1
  vcpu.0.time=379080000000
  net.count=1
  net.0.name=macvtap0
  net.0.rx.bytes=21969
  net.0.rx.pkts=429
  net.0.rx.errs=0
  net.0.rx.drop=0
  net.0.tx.bytes=79374762
  net.0.tx.pkts=851238
  net.0.tx.errs=0
  net.0.tx.drop=0
  block.count=6
  block.0.name=hda
  block.0.path=/var/lib/libvirt/images/kvm-win7-x86_64.1419400094
  block.0.rd.reqs=0
  block.0.rd.bytes=0
  block.0.rd.times=0
  block.0.wr.reqs=0
  block.0.wr.bytes=0
  block.0.wr.times=0
  block.0.fl.reqs=0
  block.0.fl.times=0
  block.0.allocation=0
  block.0.capacity=10737418240
  block.0.physical=200704
  block.1.name=hda
  block.1.path=/var/lib/libvirt/images/kvm-win7-x86_64.img
  block.1.backingIndex=1
  block.1.rd.reqs=0
  block.1.rd.bytes=0
  block.1.rd.times=0
  block.1.wr.reqs=0
  block.1.wr.bytes=0
  block.1.wr.times=0
  block.1.fl.reqs=0
  block.1.fl.times=0
  block.1.allocation=0
  block.1.capacity=10737418240
  block.1.physical=10737426432
  block.2.name=hdb
  block.2.path=/var/lib/libvirt/images/r70.1419400094
  block.2.rd.reqs=0
  block.2.rd.bytes=0
  block.2.rd.times=0
  block.2.wr.reqs=0
  block.2.wr.bytes=0
  block.2.wr.times=0
  block.2.fl.reqs=0
  block.2.fl.times=0
  block.2.allocation=0
  block.2.capacity=4294967296
  block.2.physical=200704
  block.3.name=hdb
  block.3.path=/var/lib/libvirt/images/r70.img
  block.3.backingIndex=1
  block.3.rd.reqs=0
  block.3.rd.bytes=0
  block.3.rd.times=0
  block.3.wr.reqs=0
  block.3.wr.bytes=0
  block.3.wr.times=0
  block.3.fl.reqs=0
  block.3.fl.times=0
  block.3.allocation=0
  block.3.capacity=4294967296
  block.3.physical=1203437568
  block.4.name=hdc
  block.4.path=/var/lib/libvirt/images/noos.1419400094
  block.4.rd.reqs=0
  block.4.rd.bytes=0
  block.4.rd.times=0
  block.4.wr.reqs=0
  block.4.wr.bytes=0
  block.4.wr.times=0
  block.4.fl.reqs=0
  block.4.fl.times=0
  block.4.allocation=0
  block.4.capacity=10485760
  block.4.physical=200704
  block.5.name=hdc
  block.5.path=/var/lib/libvirt/images/noos.img
  block.5.backingIndex=1
  block.5.rd.reqs=1
  block.5.rd.bytes=512
  block.5.rd.times=440514
  block.5.wr.reqs=0
  block.5.wr.bytes=0
  block.5.wr.times=0
  block.5.fl.reqs=0
  block.5.fl.times=0
  block.5.allocation=0
  block.5.capacity=10485760

Comment 6 errata-xmlrpc 2015-03-05 07:57:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0334.html


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