Bug 1175314

Summary: Update libvirt perl bindings to pick up the new flag for fetching backing chain statistics
Product: Red Hat Enterprise Linux 7 Reporter: Jiri Denemark <jdenemar>
Component: perl-Sys-VirtAssignee: Daniel Berrangé <berrange>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: urgent    
Version: 7.1CC: alitke, amureini, areis, bmcclain, bsarathy, codong, cwei, dyuan, eblake, famz, fsimonce, herrold, iheim, jcody, jdenemar, jsuchane, juzhang, lmiksik, mjenner, mkenneth, mzhan, pbonzini, rbalakri, scohen, shyu, tburke, virt-bugs, xuzhang, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: perl-Sys-Virt-1.2.8-6.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1041569 Environment:
Last Closed: 2015-03-05 10:54:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1041569    
Bug Blocks:    

Description Jiri Denemark 2014-12-17 13:38:27 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. perl -e 'require Sys::Virt; printf("%d\n",
Sys::Virt::Domain->GET_ALL_DOMAINS_STATS_BACKING);

Expected results:
1073741824

Comment 1 Daniel Berrangé 2014-12-17 14:11:06 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 3 zhe peng 2014-12-23 10:05:18 UTC
verify with build:
perl-Sys-Virt-1.2.8-6.el7

# perl -e 'require Sys::Virt; printf("%d\n",Sys::Virt::Domain->GET_ALL_STATS_BACKING)'
1073741824

check doc:
# man  /usr/share/man/man3/Sys::Virt::Domain.3pm.gz
....
Sys::Virt::Domain::GET_ALL_STATS_BACKING
           Get stats for image backing files too
....

move to verified.

Comment 5 errata-xmlrpc 2015-03-05 10:54:23 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-0470.html