Bug 1535125

Summary: Mirror jobs for drives with iothreads make QEMU to abort with "block.c:1895: bdrv_attach_child: Assertion `bdrv_get_aio_context(parent_bs) == bdrv_get_aio_context(child_bs)' failed." [rhel-7.4.z]
Product: Red Hat Enterprise Linux 7 Reporter: Oneata Mircea Teodor <toneata>
Component: qemu-kvm-rhevAssignee: Stefan Hajnoczi <stefanha>
Status: CLOSED ERRATA QA Contact: Qianqian Zhu <qizhu>
Severity: high Docs Contact:
Priority: high    
Version: 7.4CC: aliang, amureini, chayang, coli, gwatson, juzhang, knoel, michen, mkalinin, mtessun, qizhu, slopezpa, stefanha, virt-maint, xfu
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.9.0-16.el7_4.14 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1534491 Environment:
Last Closed: 2018-03-08 10:04:50 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: 1534491    
Bug Blocks:    

Description Oneata Mircea Teodor 2018-01-16 16:32:49 UTC
This bug has been copied from bug #1534491 and has been proposed to be backported to 7.4 z-stream (EUS).

Comment 3 Miroslav Rezanina 2018-01-18 06:36:00 UTC
Fix included in qemu-kvm-rhev-2.9.0-16.el7_4.14

Comment 4 Qianqian Zhu 2018-01-18 07:25:09 UTC
Verified on qemu-kvm-rhev-2.9.0-16.el7_4.14.x86_64:

Steps:
1. # qemu-img create -f raw base.img 1g
2. # qemu-img create -f qcow2 -o backing_file=base.img top1.qcow2
Formatting 'top1.qcow2', fmt=qcow2 size=1073741824 backing_file=base.img encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
3. # qemu-img create -f qcow2 -o backing_file=base.img top2.qcow2
4. # /usr/libexec/qemu-kvm -m 1g -drive if=none,file=top1.qcow2,format=qcow2,id=drive0 -object iothread,id=iothread0 -device virtio-blk-pci,iothread=iothread0,drive=drive0 -monitor stdio 
5. (qemu) drive_mirror -n drive0 top2.qcow2
6. (qemu) info block-jobs
Type mirror, device drive0: Completed 0 of 0 bytes, speed limit 0 bytes/s
7. (qemu)  block_job_complete drive0

Result:
Block job completed correctly:
(qemu) info block
drive0 (#block516): top2.qcow2 (qcow2)
    Cache mode:       writethrough
    Backing file:     base.img (chain depth: 1)

ide1-cd0: [not inserted]
    Removable device: not locked, tray closed

floppy0: [not inserted]
    Removable device: not locked, tray closed

sd0: [not inserted]
    Removable device: not locked, tray closed
(qemu) quit

Comment 6 Qianqian Zhu 2018-01-18 09:16:07 UTC
Moving to VERIFIED per comment 4

Comment 9 errata-xmlrpc 2018-03-08 10:04:50 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/RHBA-2018:0468