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.
Bug 971312 - block: Mirroring to raw block device doesn't zero out unused blocks
Summary: block: Mirroring to raw block device doesn't zero out unused blocks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Jeff Cody
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 971297 1136382
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-06 09:16 UTC by juzhang
Modified: 2016-05-10 20:56 UTC (History)
12 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.489.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 971297
Environment:
Last Closed: 2016-05-10 20:56:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0815 0 normal SHIPPED_LIVE qemu-kvm bug fix and enhancement update 2016-05-10 22:39:31 UTC

Comment 6 Jeff Nelson 2016-02-19 00:11:23 UTC
Fix included in qemu-kvm-0.12.1.2-2.489.el6

Comment 8 jingzhao 2016-03-01 03:04:59 UTC
Didn't reproduced with kernel-2.6.32-620.el6.x86_64 and qemu-img-rhev-0.12.1.2-2.489.el6.x86_64 

Following is the verified steps:
1.dd if=/dev/urandom of=/home/0223/test.raw bs=1M count=64
2.sudo losetup /dev/loop0 /home/0223/test.raw
3.chmod 666 /dev/loop0
4.Befor mirror,
[root@localhost 0223]# hexdump -n 512 test.raw 
0000000 077c 2b62 a3d0 c821 6044 2165 e3e1 d316
0000010 002b 2bdb 8c1e 8bd7 9bc0 c0d0 79fb d6d1
....................
5.Boot guest with cli:
/usr/libexec/qemu-kvm \
-name rhel6.6.0 \
-machine rhel6.6.0,accel=kvm \
-realtime mlock=off \
-cpu SandyBridge \
-m 4G   \
-smp 4,cores=1,threads=1,sockets=4  \
-uuid 49a3438a-70a3-4ba8-92ce-3a05e0934608 \
-nodefaults \
-rtc base=utc,driftfix=slew \
-monitor unix:/tmp/monitor-unix,server,nowait \
-serial unix:/tmp/serial0,server,nowait \
-global kvm-pit.lost_tick_policy=discard \
-global PIIX4_PM.disable_s3=1 \
-global PIIX4_PM.disable_s4=1 \
-boot order=c,menu=on,strict=on \
-device virtio-scsi-pci,id=scsi \
-drive file=/home/0223/rhel68bk.qcow2,if=none,format=qcow2,id=drive-virtio-scsi,werror=stop,rerror=stop \
-device scsi-hd,drive=drive-virtio-scsi,id=virtio-scsi,bus=scsi.0,scsi-id=0 \
-drive file=/home/0223/target.qcow2,if=none,format=qcow2,id=drive-virtio-scsi1,werror=stop,rerror=stop \
-device scsi-hd,drive=drive-virtio-scsi1,id=virtio-scsi1,bus=scsi.0,scsi-id=1 \
-drive file=/home/0223/test.raw,if=none,id=img \
-device ide-drive,drive=img,id=sys-img \
-netdev tap,id=hostnet0,vhost=on \
-device virtio-net-pci,netdev=hostnet0,id=net0,vectors=0,mac=00:1a:4a:42:0a:00 \
-monitor stdio \
-qmp tcp:0:4466,server,nowait -serial unix:/tmp/ttym,server,nowait \
-vga qxl \
-spice port=5910,password=redhat-vga,disable-ticketing \
-k en-us \

5.Do the mirror with /home/0223/test.raw 
6.After the mirror complete,
[root@localhost 0223]# hexdump -n 512 test.raw 
0000000 077c 2b62 a3d0 c821 6044 2165 e3e1 d316
0000010 002b 2bdb 8c1e 8bd7 9bc0 c0d0 79fb d6d1
0000020 a87c 97b3 7508 8b14 7795 c2e4 a6a1 b048
.....................

Comment 9 jingzhao 2016-03-01 08:50:05 UTC
Didn't reproduced the issue and updated the test steps
1. create an empty qcow2 file
# qemu-img create -f qcow2 /tmp/test.qcow2 64M

2. dd a file and association it with a loop device
# dd if=/dev/urandom of=/tmp/test.raw bs=1M count=64
# losetup /dev/loop2 /tmp/test.raw
# chmod 666 /dev/loop2

3. boot guest and do mirror job to the loop device
# /usr/libexec/qemu-kvm \
-drive file=/tmp/test.qcow2,format=qcow2,if=none,id=drive-virtio-blk1,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=drive-virtio-blk1,id=virtio-blk1 \
-monitor stdio
(qemu) __com.redhat_drive-mirror drive-virtio-blk1 /dev/loop2 existing raw
(qemu) __com.redhat_drive-reopen drive-virtio-blk1 /dev/loop2
(qemu) quit 

4. check the loop device
[root@localhost 0223]# hexdump -n 512 /dev/loop2
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0000200

Comment 10 jingzhao 2016-03-03 01:49:01 UTC
---Updated the comments
1) can reproduced the issue with qemu-kvm-rhev-0.12.1.2-2.488.el6.x86_64
1. create an empty qcow2 file
# qemu-img create -f qcow2 /tmp/test.qcow2 64M

2. dd a file and association it with a loop device
# dd if=/dev/urandom of=/tmp/test.raw bs=1M count=64
# losetup /dev/loop4 /tmp/test.raw
# chmod 666 /dev/loop4

3. boot guest and do mirror job to the loop device
# /usr/libexec/qemu-kvm \
-drive file=/tmp/test.qcow2,format=qcow2,if=none,id=drive-virtio-blk1,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=drive-virtio-blk1,id=virtio-blk1 \
-monitor stdio
(qemu) __com.redhat_drive-mirror drive-virtio-blk1 /dev/loop4 existing raw
(qemu) __com.redhat_drive-reopen drive-virtio-blk1 /dev/loop4
(qemu) quit 

4. check the loop device
[[root@localhost tmp]# hexdump -n 512 /dev/loop4
0000000 3829 5906 1fe6 9f71 2a24 f95b 4a0f 917b
0000010 4f9b aa23 8208 00d1 3c29 f1f0 2e9a 9358
0000020 a23c e9f3 5a5a a3e2 620e dc2a d4f9 ef81
..........

2) Didn't reproduced with qemu-kvm-rhev-0.12.1.2-2.489.el6.x86_64

1. create an empty qcow2 file
# qemu-img create -f qcow2 /tmp/test.qcow2 64M

2. dd a file and association it with a loop device
# dd if=/dev/urandom of=/tmp/test.raw bs=1M count=64
# losetup /dev/loop4 /tmp/test.raw
# chmod 666 /dev/loop4

3. boot guest and do mirror job to the loop device
# /usr/libexec/qemu-kvm \
-drive file=/tmp/test.qcow2,format=qcow2,if=none,id=drive-virtio-blk1,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=drive-virtio-blk1,id=virtio-blk1 \
-monitor stdio
(qemu) __com.redhat_drive-mirror drive-virtio-blk1 /dev/loop4 existing raw
(qemu) __com.redhat_drive-reopen drive-virtio-blk1 /dev/loop4
(qemu) quit

4.check the loop device
[root@localhost tmp]# hexdump -n 512 /dev/loop4
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0000200

Comment 12 Guo, Zhiyi 2016-03-22 10:08:23 UTC
Verify on qemu-kvm-rhev-0.12.1.2-2.490.el6.x86_64.rpm:
host:2.6.32-633.el6.x86_64
1. create an empty qcow2 file
# qemu-img create -f qcow2 /tmp/test.qcow2 64M

2. dd a file and association it with a loop device
# dd if=/dev/urandom of=/tmp/test.raw bs=1M count=64
# losetup /dev/loop1 /tmp/test.raw
# chmod 666 /dev/loop1

3. boot guest and do mirror job to the loop device
# /usr/libexec/qemu-kvm \
-drive file=/tmp/test.qcow2,format=qcow2,if=none,id=drive-virtio-blk1,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=drive-virtio-blk1,id=virtio-blk1 \
-monitor stdio
(qemu) __com.redhat_drive-mirror drive-virtio-blk1 /dev/loop1 existing raw
(qemu) __com.redhat_drive-reopen drive-virtio-blk1 /dev/loop1
(qemu) quit

4.check the loop device
[root@localhost tmp]# hexdump -n 512 /dev/loop4
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0000200

Comment 14 errata-xmlrpc 2016-05-10 20:56:44 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://rhn.redhat.com/errata/RHBA-2016-0815.html


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