Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1196067

Summary: Rebuild libvirt python bindings for COPY_DEV flag
Product: Red Hat Enterprise Linux 7 Reporter: Jan Kurik <jkurik>
Component: libvirt-pythonAssignee: Jiri Denemark <jdenemar>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.1CC: alitke, amureini, bazulay, bhamrick, cmestreg, cww, eblake, ecohen, fromani, gklein, honzhang, iheim, jdenemar, jherrman, kgoldbla, lpeer, lsurette, michele, mjenner, mkalinin, nsoffer, ogofen, pkrempa, pm-eus, rbalakri, rlocke, scohen, sherold, shyu, vanhoof, virt-bugs, yeylon, ylavi
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-python-1.2.8-7.el7_1.1 Doc Type: Bug Fix
Doc Text:
The block copy operation has previously been adjusted to change the disk type of the copied disk to "file". However, using block copy for moving block-based storage thus converted the new target to an incorrect type. Consequently, if a virtual disk was backed by a block device rather than a file, libvirt did not report the allocation information necessary to track a thin-provisioned volume. This update introduces a libvirt flag that makes it possible to specify that the target will be treated as a block device. As a result, users can now perform a block copy to a block target correctly.
Story Points: ---
Clone Of: 1195848 Environment:
Last Closed: 2015-03-06 13:01:30 UTC Type: ---
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: 1195848    
Bug Blocks: 1176673    

Description Jan Kurik 2015-02-25 09:06:42 UTC
This bug has been copied from bug #1195848 and has been proposed
to be backported to 7.1 z-stream (EUS).

Comment 7 hongming 2015-02-27 07:42:49 UTC
Verify it as follows. The result is expected. Move its status to VERIFIED.

# rpm -q libvirt libvirt-python
libvirt-1.2.8-16.el7_1.1.x86_64
libvirt-python-1.2.8-7.el7_1.1.x86_64

# virsh list --transient
 Id    Name                           State
----------------------------------------------------
 15    rh7                            running


# virsh dumpxml rh7|grep disk -A8
    <disk type='block' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source dev='/dev/vg01/lv03'/>
      <backingStore type='block' index='1'>
        <format type='qcow2'/>
        <source dev='/dev/vg01/lv05'/>
        <backingStore/>
      </backingStore>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>

# python -c "import libvirt; print libvirt.VIR_DOMAIN_BLOCK_REBASE_COPY_DEV"
32


# cat blockcopy.py
import libvirt
import sys

con = libvirt.open()
domain = con.lookupByName(sys.argv[1])
domain.blockRebase( "vda" , "/dev/vg01/lv02" , 10 , libvirt.VIR_DOMAIN_BLOCK_REBASE_COPY|libvirt.VIR_DOMAIN_BLOCK_REBASE_COPY_DEV)


# python blockcopy.py rh7


# virsh dumpxml rh7|grep disk -A20
    <disk type='block' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source dev='/dev/vg01/lv03'/>
      <backingStore type='block' index='1'>
        <format type='qcow2'/>
        <source dev='/dev/vg01/lv05'/>
        <backingStore/>
      </backingStore>
      <mirror type='block' job='copy' ready='yes'>
        <format type='qcow2'/>
        <source dev='/dev/vg01/lv02'/>
      </mirror>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>

Comment 9 errata-xmlrpc 2015-03-06 13:01:30 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-0646.html