Bug 1473145

Summary: Wrong allocation value after virDomainBlockCopy() (alloc=capacity)
Product: Red Hat Enterprise Linux 7 Reporter: Oneata Mircea Teodor <toneata>
Component: qemu-kvm-rhevAssignee: Kevin Wolf <kwolf>
Status: CLOSED ERRATA QA Contact: Avihai <aefrat>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.4CC: aefrat, amureini, areis, baptiste.agasse, berrange, bmcclain, chayang, cshao, ddepaula, dyuan, ebenahar, hhan, jsuchane, juzhang, knoel, kwolf, lmen, michen, mkalinin, mrezanin, mtessun, nsoffer, qizhu, ratamir, rbalakri, salmy, sgordon, toneata, virt-bugs, virt-maint, xuzhang
Target Milestone: rcKeywords: Regression, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.9.0-16.el7_4.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1470634 Environment:
Last Closed: 2017-08-01 23:25:33 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: 1470634    
Bug Blocks: 1461536    

Description Oneata Mircea Teodor 2017-07-20 06:25:20 UTC
This bug has been copied from bug #1470634 and has been proposed to be backported to 7.4 z-stream (EUS).

Comment 6 Miroslav Rezanina 2017-07-20 17:58:35 UTC
Fix included in qemu-kvm-rhev-2.9.0-16.el7_4.3

Comment 14 Qianqian Zhu 2017-07-26 06:54:14 UTC
Verified from qemu-kvm-rhev side:

Version:
qemu-kvm-rhev-2.9.0-16.el7_4.3.x86_64

Steps:
1. Launch guest with a secondary disk:

/usr/libexec/qemu-kvm -name rhel7_4 -m 1G -smp 2  -drive file=/home/kvm_autotest_root/images/rhel74-64-virtio.qcow2,format=qcow2,id=drive_image1,if=none,cache=none,media=disk -device virtio-blk-pci,drive=drive_image1,id=virtio-blk-0,bootindex=0 -qmp stdio -vnc :3 -netdev tap,id=hostnet0,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=70:e2:84:14:0e:15 \
-drive file=/home/test.raw,id=drive_image2,format=raw,if=none,cache=none,media=disk -device virtio-blk-pci,drive=drive_image2,id=virtio-blk-1

2. Live snapshot:
{ "execute": "blockdev-snapshot-sync", "arguments": { "device": "drive_image2","snapshot-file": "/home/sn1", "format": "qcow2", "mode": "absolute-paths" } }

3. Drive mirror with option sync=top
{ "execute": "drive-mirror", "arguments": { "device": "drive_image2", "target":"/home/mirror.qcow2", "sync":"top", "mode": "existing"}}

4. Query block and check the information of drive_image2.

Result: 
No extra node added and the backing_file_depth keep to 1:

{"device": "drive_image2",
"inserted": {
        "image": {
                "backing-image": {
                        "virtual-size": 104857600, 
                        "filename": "/home/test.raw",
                        "format": "raw", 
                        "actual-size": 0,
                        }
                "backing-filename-format": "raw",
                "virtual-size": 104857600,
                "filename": "/home/sn1",
                "cluster-size": 65536,
                "format": "qcow2", 
                "actual-size": 200704, 
                "full-backing-filename": "/home/test.raw",
                "backing-filename": "/home/test.raw",
                } 
        "node-name": "#block1002",
        "backing_file_depth": 1,
        "drv": "qcow2", 
        "backing_file": "/home/test.raw",
        "file": "/home/sn1", 
        }
}

Comment 17 errata-xmlrpc 2017-08-01 23:25:33 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://access.redhat.com/errata/RHSA-2017:2390