Bug 1122788 - qemu-img convert fail to trigger "l2_update_compressed" event using blkdebug.cfg
Summary: qemu-img convert fail to trigger "l2_update_compressed" event using blkdebug.cfg
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Max Reitz
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1122792
TreeView+ depends on / blocked
 
Reported: 2014-07-24 05:53 UTC by Sibiao Luo
Modified: 2014-07-29 14:31 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1122792 (view as bug list)
Environment:
Last Closed: 2014-07-29 14:31:35 UTC


Attachments (Terms of Use)

Description Sibiao Luo 2014-07-24 05:53:56 UTC
Description of problem:
when we test case as same to bug 790350, but qemu-img convert fail to trigger "l2_update_compressed" event using blkdebug.cfg. 

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm-rhev
2.6.32-492.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.430.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.create file 
#cat blkdebug.cfg
[inject-error]
event = "l2_update_compressed"
errno = "28"
immediately = "off"
2.qemu-img create -f qcow2 -o cluster_size=512 sourcecompress.qcow2 10G
3.qemu-io blkdebug:blkdebug.cfg:sourcecompress.qcow2 -c "write 0 64M"
4.qemu-img convert -c -f qcow2 -O qcow2 sourcecompress.qcow2 compressed.qcow2
5.qemu-io blkdebug:blkdebug.cfg:compressed.qcow2 -c "write 0 64M"
6.qemu-img convert -c -f qcow2 -O qcow2 sourcecompress.qcow2
blkdebug:blkdebug.cfg:compressed.qcow2

Actual results:
after step 6,
# qemu-img convert -p -c -f qcow2 -O qcow2 sourcecompress.qcow2 blkdebug:blkdebug.cfg:compressed.qcow2
Formatting not supported for file format 'qcow2'

Expected results:
it can trigger event named "l2_update_compressed", e.g.qemu-img: error while compressing sector 0: Input/output error)

Additional info:

Comment 1 Sibiao Luo 2014-07-24 06:10:41 UTC
Also tried the qemu-kvm-rhev-0.12.1.2-2.427.el6.x86_64 which also hit it.
# qemu-img create -f qcow2 -o cluster_size=512 sourcecompress.qcow2 10G;qemu-io blkdebug:blkdebug.cfg:sourcecompress.qcow2 -c "write 0 64M";qemu-img convert -c -f qcow2 -O qcow2 sourcecompress.qcow2 compressed.qcow2;qemu-io blkdebug:blkdebug.cfg:compressed.qcow2 -c "write 0 64M";qemu-img convert -c -f qcow2 -O qcow2 sourcecompress.qcow2 blkdebug:blkdebug.cfg:compressed.qcow2
Formatting 'sourcecompress.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=512 
wrote 67108864/67108864 bytes at offset 0
64 MiB, 1 ops; 0:05:41.00 (192.087 KiB/sec and 0.0029 ops/sec)
wrote 67108864/67108864 bytes at offset 0
64 MiB, 1 ops; 0:01:19.00 (823.442 KiB/sec and 0.0126 ops/sec)
Formatting not supported for file format 'qcow2'              <-------------

Also tried qemu-kvm-rhev-0.12.1.2-2.415.el6.x86_64, it fail with i/o error after step 3.
# qemu-img create -f qcow2 -o cluster_size=512 sourcecompress.qcow2 10G
Formatting 'sourcecompress.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=512
# qemu-io blkdebug:blkdebug.cfg:sourcecompress.qcow2 -c "write 0 64M"
write failed: Input/output error

Best Regards,
sluo

Comment 2 Max Reitz 2014-07-24 22:37:13 UTC
Hi,

The issue is handled more clearly upstream. There, trying to create an image over blkdebug results in the following error message:

$ ./qemu-img create -f qcow2 blkdebug:blkdebug.cfg:foo.qcow2 64M
qemu-img: blkdebug:blkdebug.cfg:foo.qcow2: Driver 'blkdebug' does not support image creation

So, the real problem is blkdebug being unable to create files. This was not an issue so far, as blkdebug is just a debug tool; if you require blkdebug for such tests, we could probably implement some pass-through.

The more serious problem is the confusing (and basically wrong) error message from RHEL 6's qemu. The reason why it differs from upstream is the following: The block layer calls qcow2's creation function which then tries to create a file first. This creation fails, because blkdebug (which is below qcow2) cannot create files. Upstream, an error message is generated by the block layer which clearly denotes blkdebug to be the problem. This message is passed back to qemu-img which emits it.
In RHEL 6, this is not possible and instead the block layer simply returns -ENOTSUP which is passed through by qcow2. The top layer (bdrv_img_create()) then does its best to formulate an appropriate error message while all it knows is "tried to create qcow2 image, it failed because something is not supported".

Therefore, this is a problem inherent to RHEL 6 qemu (nearly no error strings passed through the block layer).

All in all, the question remaining is: Do you really need to be able to create files over blkdebug?


Max

Comment 3 Sibiao Luo 2014-07-29 02:45:40 UTC
(In reply to Max Reitz from comment #2)
> Hi,
> 
> The issue is handled more clearly upstream. There, trying to create an image
> over blkdebug results in the following error message:
> 
> $ ./qemu-img create -f qcow2 blkdebug:blkdebug.cfg:foo.qcow2 64M
> qemu-img: blkdebug:blkdebug.cfg:foo.qcow2: Driver 'blkdebug' does not
> support image creation
> 
> So, the real problem is blkdebug being unable to create files. This was not
> an issue so far, as blkdebug is just a debug tool; if you require blkdebug
> for such tests, we could probably implement some pass-through.
> 
Yes, the blkdebug being unable to create files, just as bug 790350 which fixed the qemu-img core dumped and gave error prompt, e.g. qemu-img: error while compressing sector 0: Input/output error)
Our KVM QE just check the error which match the trigger event "l2_update_compressed" is ok. 

> The more serious problem is the confusing (and basically wrong) error
> message from RHEL 6's qemu. The reason why it differs from upstream is the
> following: The block layer calls qcow2's creation function which then tries
> to create a file first. This creation fails, because blkdebug (which is
> below qcow2) cannot create files. Upstream, an error message is generated by
> the block layer which clearly denotes blkdebug to be the problem. This
> message is passed back to qemu-img which emits it.
> In RHEL 6, this is not possible and instead the block layer simply returns
> -ENOTSUP which is passed through by qcow2. The top layer (bdrv_img_create())
> then does its best to formulate an appropriate error message while all it
> knows is "tried to create qcow2 image, it failed because something is not
> supported".
> 
> Therefore, this is a problem inherent to RHEL 6 qemu (nearly no error
> strings passed through the block layer).
> 
> All in all, the question remaining is: Do you really need to be able to
> create files over blkdebug?
> 
No need to create file over blkdebug indeed, I think just verify the error prompt which match the blkdebug event is ok. If QEMU changed this code stealthily and no any news about such changes, our KVM QE always thought this was issue here. You can decide it and we will keep this fail error prompt message reasonable and stable forever which is helpful for QE. Thanks a lot.

Best Regards,
sluo

Comment 4 Max Reitz 2014-07-29 14:31:35 UTC
> I think just verify the error prompt which match the blkdebug event is ok.
The problem is that we cannot implement the clearer error message from upstream or RHEL 7 in RHEL 6 with reasonable effort.

As you say we don't need to be able to create files over blkdebug, I'll close this and BZ 1122792.

Max


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