Bug 1118185

Summary: print wrong current progress value while do block mirroring
Product: Red Hat Enterprise Linux 6 Reporter: mazhang <mazhang>
Component: qemu-kvmAssignee: Kevin Wolf <kwolf>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.5CC: acathrow, bsarathy, juzhang, mazhang, michen, mkenneth, qzhang, shu, virt-maint
Target Milestone: rcKeywords: Regression, TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 07:51:25 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:

Description mazhang 2014-07-10 07:29:15 UTC
Description of problem:
Print wrong current progress value while do block mirroring

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

Host:
qemu-kvm-rhev-tools-0.12.1.2-2.429.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.429.el6.x86_64
gpxe-roms-qemu-0.9.7-6.11.el6.noarch
qemu-img-rhev-0.12.1.2-2.429.el6.x86_64
qemu-kvm-rhev-debuginfo-0.12.1.2-2.429.el6.x86_64
kernel-2.6.32-489.el6.x86_64

Guest:
win8.1-32

How reproducible:
always

Steps to Reproduce:
1.Boot vm with:
/usr/libexec/qemu-kvm \
-M rhel6.6.0 \
-cpu SandyBridge \
-m 4G \
-smp 4,sockets=2,cores=2,threads=1,maxcpus=160 \
-enable-kvm \
-name rhel6.6 \
-uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
-smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 \
-k en-us \
-rtc base=localtime,clock=host,driftfix=slew \
-nodefaults \
-monitor stdio \
-qmp tcp:0:6666,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-chardev socket,id=seabios,path=/tmp/seabios0,server,nowait \
-device isa-debugcon,chardev=seabios,iobase=0x402 \
-monitor unix:/tmp/socket0,server,nowait -device sga \
-vga std \
-vnc :0 \
-usb \
-device usb-tablet \
-drive file=/usr/share/virtio-win/virtio-win.iso,if=none,media=cdrom,id=drive-ide1,readonly=on,format=raw \
-device ide-drive,bus=ide.1,unit=0,drive=drive-ide1,id=ide1 \
-netdev tap,id=hostnet0,vhost=on \
-device e1000,netdev=hostnet0,id=net0,mac=52:54:00:39:13:2c \
-drive file=/home/win8.1-32.qcow2,if=none,id=drive-scsi-disk,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-scsi-pci,id=scsi0 \
-device scsi-disk,drive=drive-scsi-disk,bus=scsi0.0,scsi-id=0,lun=0,id=scsi-disk,bootindex=1 \

2.start mirroring, then query block jobs.

3.

Actual results:
The value of "len" equal to "offset" at the mirroring beginning.

[root@dhcp-8-128 ~]# telnet 0 6666
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
{"QMP": {"version": {"qemu": {"micro": 1, "minor": 12, "major": 0}, "package": "(qemu-kvm-rhev-0.12.1.2-2.429.el6)"}, "capabilities": []}}
{"execute":"qmp_capabilities"}
{"return": {}}
{ "execute" : "__com.redhat_drive-mirror", "arguments" : { "device" : "drive-scsi-disk","target" : "/root/sn1", "format": "qcow2", "mode": "absolute-paths", "full" : false } }
{"return": {}}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"device": "drive-scsi-disk", "len": 53687091200, "offset": 53687091200, "speed": 0, "type": "mirror"}]}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"device": "drive-scsi-disk", "len": 53687091200, "offset": 53687091200, "speed": 0, "type": "mirror"}]}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"device": "drive-scsi-disk", "len": 53687091200, "offset": 53687091200, "speed": 0, "type": "mirror"}]}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"device": "drive-scsi-disk", "len": 53687091200, "offset": 53687091200, "speed": 0, "type": "mirror"}]}


Expected results:
Print correct current progress value

Additional info:
qemu-kvm-rhev-0.12.1.2-2.426.el6 not hit this problem, regression ?

Comment 2 Qunfang Zhang 2014-07-10 08:10:27 UTC
The issue looks similar with bug 1109715 comment 8. However, it will be fine to use the separate bz to track the new issue.

Comment 4 Kevin Wolf 2014-07-25 11:25:42 UTC
(In reply to Qunfang Zhang from comment #2)
> The issue looks similar with bug 1109715 comment 8. However, it will be fine
> to use the separate bz to track the new issue.

Yes, I agree that this is probably the same issue. Mirroring thinks that there
are no allocated sectors, so it immediately shows that it's completed. Please
retest once the fix for bug 1109715 is included.

Comment 5 Kevin Wolf 2014-08-05 15:37:09 UTC
The patches for bug 1109715 seem to be included now. Can you please retest with
the latest build?

Comment 6 mazhang 2014-08-06 02:47:23 UTC
Test this bug on qemu-kvm-rhev-0.12.1.2-2.435.el6, the problem has gone.

Host:
qemu-img-rhev-0.12.1.2-2.435.el6.x86_64
qemu-kvm-rhev-debuginfo-0.12.1.2-2.435.el6.x86_64
qemu-kvm-rhev-tools-0.12.1.2-2.435.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.435.el6.x86_64
kernel-2.6.32-493.el6.x86_64

Guest:
win8.1-32

Result:
{"QMP": {"version": {"qemu": {"micro": 1, "minor": 12, "major": 0}, "package": "(qemu-kvm-rhev-0.12.1.2-2.435.el6)"}, "capabilities": []}}
{"execute":"qmp_capabilities"}
{"return": {}}
{ "execute" : "__com.redhat_drive-mirror", "arguments" : { "device" : "drive-scsi-disk","target" : "/root/sn1", "format": "qcow2", "mode": "absolute-paths", "full" : false } }
{"return": {}}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"device": "drive-scsi-disk", "len": 53687091200, "offset": 41198288896, "speed": 0, "type": "mirror"}]}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"device": "drive-scsi-disk", "len": 53687091200, "offset": 41343647744, "speed": 0, "type": "mirror"}]}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"device": "drive-scsi-disk", "len": 53687091200, "offset": 41487171584, "speed": 0, "type": "mirror"}]}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"device": "drive-scsi-disk", "len": 53687091200, "offset": 45333610496, "speed": 0, "type": "mirror"}]}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"device": "drive-scsi-disk", "len": 53687091200, "offset": 52372242432, "speed": 0, "type": "mirror"}]}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"device": "drive-scsi-disk", "len": 53687091200, "offset": 53687091200, "speed": 0, "type": "mirror"}]}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"device": "drive-scsi-disk", "len": 53687091200, "offset": 53687091200, "speed": 0, "type": "mirror"}]}
{ "execute": "__com.redhat_drive-reopen", "arguments": {"device": "drive-scsi-disk","new-image-file": "/root/sn1", "format": "qcow2" } }
{"timestamp": {"seconds": 1407293049, "microseconds": 598352}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "drive-scsi-disk", "len": 53687091200, "offset": 53687091200, "speed": 0, "type": "mirror"}}
{"return": {}}

Comment 7 Kevin Wolf 2014-08-06 07:51:25 UTC
Thanks for confirming. I'll close it as a duplicate then.

*** This bug has been marked as a duplicate of bug 1092117 ***