Bug 1439922

Summary: bdrv_co_do_copy_on_readv: Assertion `child->perm & (BLK_PERM_WRITE_UNCHANGED | BLK_PERM_WRITE)' failed.
Product: [Fedora] Fedora Reporter: Richard W.M. Jones <rjones>
Component: qemuAssignee: Fedora Virtualization Maintainers <virt-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: amit, berrange, cfergeau, crobinso, dwmw2, itamar, pbonzini, rjones, virt-maint
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-2.9.0-0.2.rc3.fc27 qemu-2.9.0-0.2.rc3.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-10 16:03:34 UTC Type: Bug
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:    
Bug Blocks: 910269    
Attachments:
Description Flags
test-suite.log none

Description Richard W.M. Jones 2017-04-06 20:55:30 UTC
Created attachment 1269488 [details]
test-suite.log

Description of problem:

A test in the libguestfs test suite fails with:

qemu-system-x86_64: /builddir/build/BUILD/qemu-2.9.0-rc2/block/io.c:948: bdrv_co_do_copy_on_readv: Assertion `child->perm & (BLK_PERM_WRITE_UNCHANGED | BLK_PERM_WRITE)' failed.

The test is:

https://github.com/libguestfs/libguestfs/blob/master/tests/regressions/rhbz1232192.sh

which is a regression test for bug 1232192.

Version-Release number of selected component (if applicable):

qemu-2.9.0-0.1.rc2.fc26.x86_64

How reproducible:

100%

Steps to Reproduce:
1. Run 'make check-direct' in the libguestfs test suite.

More information including the exact command line can be found
in the attached log file.

Comment 1 Richard W.M. Jones 2017-04-06 20:58:22 UTC
The qemu command line is:

/usr/bin/qemu-kvm \
    -global virtio-blk-pci.scsi=off \
    -nodefconfig \
    -enable-fips \
    -nodefaults \
    -display none \
    -machine accel=kvm:tcg \
    -cpu host \
    -m 2000 \
    -no-reboot \
    -rtc driftfix=slew \
    -no-hpet \
    -global kvm-pit.lost_tick_policy=discard \
    -kernel /home/rjones/d/libguestfs/tmp/.guestfs-1000/appliance.d/kernel \
    -initrd /home/rjones/d/libguestfs/tmp/.guestfs-1000/appliance.d/initrd \
    -object rng-random,filename=/dev/urandom,id=rng0 \
    -device virtio-rng-pci,rng=rng0 \
    -device virtio-scsi-pci,id=scsi \
    -drive file=/home/rjones/d/libguestfs/tmp/v2vovld3c613.qcow2,cache=unsafe,discard=unmap,format=qcow2,copy-on-read=on,id=hd0,if=none \
    -device scsi-hd,drive=hd0 \
    -drive file=/home/rjones/d/libguestfs/tmp/v2vovl10d0af.qcow2,cache=unsafe,discard=unmap,format=qcow2,copy-on-read=on,id=hd1,if=none \
    -device scsi-hd,drive=hd1 \
    -drive file=/home/rjones/d/libguestfs/tmp/.guestfs-1000/appliance.d/root,snapshot=on,id=appliance,cache=unsafe,if=none,format=raw \
    -device scsi-hd,drive=appliance \
    -device virtio-serial-pci \
    -serial stdio \
    -device sga \
    -chardev socket,path=/run/user/1000/libguestfs7XpIFo/guestfsd.sock,id=channel0 \
    -device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \
    -netdev user,id=usernet,net=169.254.0.0/16 \
    -device virtio-net-pci,netdev=usernet \
    -append 'panic=1 console=ttyS0 edd=off udevtimeout=6000 udev.event-timeout=6000 no_timer_check printk.time=1 cgroup_disable=memory usbcore.nousb cryptomgr.notests tsc=reliable 8250.nr_uarts=1 root=/dev/sdc selinux=0 guestfs_verbose=1 guestfs_network=1 TERM=xterm-256color guestfs_identifier=v2v'

Comment 2 Richard W.M. Jones 2017-04-06 21:13:44 UTC
The minimal reproducer appears to be:

#!/bin/bash

set -e
set -x

rm -f /tmp/blank-disk.img
truncate -s 1M /tmp/blank-disk.img

qemu-img create -b /tmp/blank-disk.img -f qcow2 /tmp/ovl1.qcow2

/usr/bin/qemu-system-x86_64 \
    -device virtio-scsi-pci,id=scsi \
    -drive file=/tmp/ovl1.qcow2,cache=unsafe,discard=unmap,format=qcow2,copy-on-read=on,id=hd0,if=none \
    -device scsi-hd,drive=hd0

-----------

When run this prints:

+ rm -f /tmp/blank-disk.img
+ truncate -s 1M /tmp/blank-disk.img
+ qemu-img create -b /tmp/blank-disk.img -f qcow2 /tmp/ovl1.qcow2
Formatting '/tmp/ovl1.qcow2', fmt=qcow2 size=1048576 backing_file=/tmp/blank-disk.img encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
+ /usr/bin/qemu-system-x86_64 -device virtio-scsi-pci,id=scsi -drive file=/tmp/ovl1.qcow2,cache=unsafe,discard=unmap,format=qcow2,copy-on-read=on,id=hd0,if=none -device scsi-hd,drive=hd0
qemu-system-x86_64: /builddir/build/BUILD/qemu-2.9.0-rc2/block/io.c:948: bdrv_co_do_copy_on_readv: Assertion `child->perm & (BLK_PERM_WRITE_UNCHANGED | BLK_PERM_WRITE)' failed.
/tmp/test.sh: line 15:  6880 Aborted                 (core dumped) /usr/bin/qemu-system-x86_64 -device virtio-scsi-pci,id=scsi -drive file=/tmp/ovl1.qcow2,cache=unsafe,discard=unmap,format=qcow2,copy-on-read=on,id=hd0,if=none -device scsi-hd,drive=hd0

Comment 3 Cole Robinson 2017-04-06 23:12:26 UTC
I suggest raising it on qemu-devel since we are still in rc phase

Comment 5 Richard W.M. Jones 2017-04-08 08:37:37 UTC
The upstream commit is 1bf03e66fd03af46ff0f98dd04b6e28f432ac1e3.

Comment 6 Richard W.M. Jones 2017-04-08 08:40:59 UTC
https://koji.fedoraproject.org/koji/taskinfo?taskID=18852635

Comment 7 Fedora Update System 2017-04-08 14:39:38 UTC
qemu-2.9.0-0.2.rc3.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-0d191d9d55

Comment 8 Fedora Update System 2017-04-09 05:54:03 UTC
qemu-2.9.0-0.2.rc3.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-0d191d9d55

Comment 9 Fedora Update System 2017-04-10 16:03:34 UTC
qemu-2.9.0-0.2.rc3.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.