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.
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."
Description of problem:
* Preparing the images
# qemu-img create -f raw base.img 1g
# qemu-img create -f qcow2 -o backing_file=base.img top1.qcow2
# qemu-img create -f qcow2 -o backing_file=base.img top2.qcow2
* Running with iothreads
# /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
QEMU 2.9.0 monitor - type 'help' for more information
(qemu) drive_mirror -n drive0 top2.qcow2
(qemu) info block-jobs
Type mirror, device drive0: Completed 0 of 0 bytes, speed limit 0 bytes/s
(qemu) block_job_complete drive0
qemu-kvm: block.c:1895: bdrv_attach_child: Assertion `bdrv_get_aio_context(parent_bs) == bdrv_get_aio_context(child_bs)' failed.
Aborted (core dumped)
* Running without iothreads
# /usr/libexec/qemu-kvm -m 1g -drive if=none,file=top1.qcow2,format=qcow2,id=drive0 -device virtio-blk-pci,drive=drive0 -monitor stdio
QEMU 2.9.0 monitor - type 'help' for more information
(qemu) drive_mirror -n drive0 top2.qcow2
(qemu) info block-jobs
Type mirror, device drive0: Completed 0 of 0 bytes, speed limit 0 bytes/s
(qemu) block_job_complete drive0
(qemu) info block-jobs
No active jobs
Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.9.0-16.el7_4.13.x86_64
How reproducible:
Always
Additional info:
This has been fixed in upstream by this oneliner:
<snip>
[slopezpa@dritchie qemu]$ git show 5ce6bfe255091d532ec4555d0ede816294cb1703
commit 5ce6bfe255091d532ec4555d0ede816294cb1703
Author: sochin.jiang <sochin.jiang>
Date: Mon Jun 26 19:04:24 2017 +0800
mirror: Fix inconsistent backing AioContext for after mirroring
mirror_complete opens the backing chain, which should have the same
AioContext as the top when using iothreads. Make the code guarantee
this, which fixes a failed assertion in bdrv_attach_child.
Signed-off-by: sochin.jiang <sochin.jiang>
Message-id: 1498475064-39816-1-git-send-email-sochin.jiang
[mreitz: Reworded commit message]
Signed-off-by: Max Reitz <mreitz>
diff --git a/block.c b/block.c
index edfa6b7a2c..b9e5114a27 100644
--- a/block.c
+++ b/block.c
@@ -2185,6 +2185,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
ret = -EINVAL;
goto free_exit;
}
+ bdrv_set_aio_context(backing_hd, bdrv_get_aio_context(bs));
/* Hook up the backing file link; drop our reference, bs owns the
* backing_hd reference now */
</snip>
Please consider backporting this. Thanks.
Reproduced on qemu-kvm-rhev-10:2.9.0-14.el7.x86_64 with steps in comment 0.
If mirror source file is base, wont trigger the core dump, the source file must be a snapshot for this issue.
Same steps work well on qemu-kvm-rhev-2.10.0-16.el7.x86_64, so the latest version qemu should have already fixed this issue.
(In reply to Qianqian Zhu from comment #4)
> Reproduced on qemu-kvm-rhev-10:2.9.0-14.el7.x86_64 with steps in comment 0.
>
> If mirror source file is base, wont trigger the core dump, the source file
> must be a snapshot for this issue.
>
> Same steps work well on qemu-kvm-rhev-2.10.0-16.el7.x86_64, so the latest
> version qemu should have already fixed this issue.
Indeed, I confirmed the upstream patch pointed in Comment #0 is included in qemu-2.10, changing BZ to MODIFIED.
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-2018:1104
Description of problem: * Preparing the images # qemu-img create -f raw base.img 1g # qemu-img create -f qcow2 -o backing_file=base.img top1.qcow2 # qemu-img create -f qcow2 -o backing_file=base.img top2.qcow2 * Running with iothreads # /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 QEMU 2.9.0 monitor - type 'help' for more information (qemu) drive_mirror -n drive0 top2.qcow2 (qemu) info block-jobs Type mirror, device drive0: Completed 0 of 0 bytes, speed limit 0 bytes/s (qemu) block_job_complete drive0 qemu-kvm: block.c:1895: bdrv_attach_child: Assertion `bdrv_get_aio_context(parent_bs) == bdrv_get_aio_context(child_bs)' failed. Aborted (core dumped) * Running without iothreads # /usr/libexec/qemu-kvm -m 1g -drive if=none,file=top1.qcow2,format=qcow2,id=drive0 -device virtio-blk-pci,drive=drive0 -monitor stdio QEMU 2.9.0 monitor - type 'help' for more information (qemu) drive_mirror -n drive0 top2.qcow2 (qemu) info block-jobs Type mirror, device drive0: Completed 0 of 0 bytes, speed limit 0 bytes/s (qemu) block_job_complete drive0 (qemu) info block-jobs No active jobs Version-Release number of selected component (if applicable): qemu-kvm-rhev-2.9.0-16.el7_4.13.x86_64 How reproducible: Always Additional info: This has been fixed in upstream by this oneliner: <snip> [slopezpa@dritchie qemu]$ git show 5ce6bfe255091d532ec4555d0ede816294cb1703 commit 5ce6bfe255091d532ec4555d0ede816294cb1703 Author: sochin.jiang <sochin.jiang> Date: Mon Jun 26 19:04:24 2017 +0800 mirror: Fix inconsistent backing AioContext for after mirroring mirror_complete opens the backing chain, which should have the same AioContext as the top when using iothreads. Make the code guarantee this, which fixes a failed assertion in bdrv_attach_child. Signed-off-by: sochin.jiang <sochin.jiang> Message-id: 1498475064-39816-1-git-send-email-sochin.jiang [mreitz: Reworded commit message] Signed-off-by: Max Reitz <mreitz> diff --git a/block.c b/block.c index edfa6b7a2c..b9e5114a27 100644 --- a/block.c +++ b/block.c @@ -2185,6 +2185,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options, ret = -EINVAL; goto free_exit; } + bdrv_set_aio_context(backing_hd, bdrv_get_aio_context(bs)); /* Hook up the backing file link; drop our reference, bs owns the * backing_hd reference now */ </snip> Please consider backporting this. Thanks.