Bug 1492178 - Non-top-level change-backing-file causes assertion failure
Summary: Non-top-level change-backing-file causes assertion failure
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Kevin Wolf
QA Contact: Qianqian Zhu
Depends On:
TreeView+ depends on / blocked
Reported: 2017-09-15 16:20 UTC by Kevin Wolf
Modified: 2018-06-15 16:37 UTC (History)
11 users (show)

Clone Of:
Last Closed: 2018-04-11 00:36:03 UTC

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:1104 None None None 2018-04-11 00:37 UTC

Description Kevin Wolf 2017-09-15 16:20:31 UTC
The following was tested on upstream qemu.git master. 2.10 is affected.

Steps to reproduce the assertion failure:

1. Create a backing file chain with at least three images:

$ qemu-img create -f qcow2 /tmp/base.qcow2 64M
$ qemu-img create -f qcow2 -b /tmp/base.qcow2 /tmp/mid.qcow2
$ qemu-img create -f qcow2 -b /tmp/mid.qcow2 /tmp/top.qcow2

2. Try to use the "change-backing-file" QMP command to change the backing file of mid.qcow2:

$ LANG=C x86_64-softmmu/qemu-system-x86_64 -drive file=/tmp/top.qcow2,backing.node-name=mid -qmp stdio
{"QMP": {"version": {"qemu": {"micro": 50, "minor": 10, "major": 2}, "package": " (v2.10.0-485-g6beb456cac)"}, "capabilities": []}}
{"return": {}}
{"execute":"change-backing-file", "arguments":{"device":"ide0-hd0","image-node-name":"mid","backing-file":"/dev/null"}}
qemu-system-x86_64: block/io.c:1359: bdrv_aligned_pwritev: Assertion `child->perm & BLK_PERM_WRITE' failed.

This will be fixed upstream with the following series:

    [PATCH 0/6] block: Fix permissions after ro/rw reopen

Comment 3 Miroslav Rezanina 2017-12-05 12:58:37 UTC
Fix included in qemu-kvm-rhev-2.10.0-11.el7

Comment 5 Qianqian Zhu 2017-12-06 08:15:40 UTC
Reproduced on qemu-kvm-rhev-10:2.10.0-9.el7:

[root@dhcp-8-119 pkgs]# qemu-img create -f qcow2 /tmp/base.qcow2 64M
[root@dhcp-8-119 pkgs]#  qemu-img create -f qcow2 -b /tmp/base.qcow2 /tmp/mid.qcow2
[root@dhcp-8-119 pkgs]# qemu-img create -f qcow2 -b /tmp/mid.qcow2 /tmp/top.qcow2

[root@dhcp-8-119 pkgs]# /usr/libexec/qemu-kvm -drive file=/tmp/top.qcow2,backing.node-name=mid -qmp stdio
{"QMP": {"version": {"qemu": {"micro": 0, "minor": 10, "major": 2}, "package": "(qemu-kvm-rhev-2.10.0-9.el7)"}, "capabilities": []}}
VNC server running on ::1:5900
{"return": {}}
{"execute":"change-backing-file", "arguments":{"device":"ide0-hd0","image-node-name":"mid","backing-file":"/dev/null"}}

qemu-kvm: block/io.c:1359: bdrv_aligned_pwritev: Assertion `child->perm & BLK_PERM_WRITE' failed.
Aborted (core dumped)

Verified on qemu-kvm-rhev-10:2.10.0-11.el7:
Same as above.

Change backing file success.
 "backing-filename": "/dev/null"

Moving to VERIFIED based on above result.

Comment 7 errata-xmlrpc 2018-04-11 00:36:03 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.


Note You need to log in before you can comment on or make changes to this bug.