Bug 1252372

Summary: drive_mirror can't be done on 'raw' type drive
Product: Red Hat Enterprise Linux 7 Reporter: Zhengtong <zhengtli>
Component: qemu-kvm-rhevAssignee: Jeff Cody <jcody>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: hannsj_uhl, juzhang, knoel, michen, qzhang, thuth, virt-maint, zhengtli
Target Milestone: rc   
Target Release: ---   
Hardware: ppc64le   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-21 07:20:10 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: 1201513    

Description Zhengtong 2015-08-11 09:23:44 UTC
Description of problem:

Do drive_mirror through qmp on raw type drive, target mirror file size is not normal. 

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.3.0-16.el7

How reproducible:
100%

Steps to Reproduce:
1.Start guest on powerpc with raw type drive:
qemu-kvm ...
-drive file=/root/test_home/liuzt/vdisk/rhel7.2_be_dataplane.raw,if=none,id=drive-scsi0-0-0-0,format=raw,cache=none,rerror=stop,werror=stop \
-device virtio-blk-pci,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bus=pci.0,addr=0x3,bootindex=1 \
...

2.After guest boot up , do drive_mirror with qmp cli.

{ "execute":  "drive-mirror", "arguments": { "device": "drive-scsi0-0-0-0", "target":  "/root/test_home/liuzt/vdisk/mirror.raw", "format": "raw", "mode": "absolute-paths", "sync":  "full", "speed": 1000000000, "on-source-error": "stop",  "on-target-error": "stop" } }

3.Check target file /root/test_home/liuzt/vdisk/mirror.raw

Actual results:

/root/test_home/liuzt/vdisk/mirror.raw exist, but the size is always 196K. 

Expected results:

the size should be same with that of origin drive image.

Additional info:

Qemu cmd: 
/usr/libexec/qemu-kvm -name liuzt-RHEL-7.2_BE -machine pseries,accel=kvm,usb=off -m 8192 -realtime mlock=off -smp 4,sockets=1,cores=2,threads=2 \
-rtc base=localtime,clock=host,driftfix=slew \
-monitor stdio \
-no-shutdown \
-boot strict=on \
-device usb-ehci,id=usb,bus=pci.0,addr=0x1 \
-device pci-ohci,id=usb1,bus=pci.0,addr=0x2 \
-drive file=/root/test_home/liuzt/vdisk/rhel7.2_be_dataplane.raw,if=none,id=drive-scsi0-0-0-0,format=raw,cache=none,rerror=stop,werror=stop \
-device virtio-blk-pci,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bus=pci.0,addr=0x3,bootindex=1 \
-drive file=/root/test_home/liuzt/vdisk/RHEL-7.2-20150806.1-Server-ppc64-dvd1.iso,id=drive-scsi0-0-0-1,format=raw,if=none \
-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x4 \
-device scsi-cd,drive=drive-scsi0-0-0-1,bus=scsi0.0,bootindex=2 \
-drive file=/root/test_home/liuzt/vdisk/test.img,id=test,if=none,format=qcow2,cache=none \
-device scsi-hd,drive=test,bus=scsi0.0 \
-serial pty \
-device usb-kbd,id=input0 \
-device usb-mouse,id=input1 \
-device usb-tablet,id=input2 \
-vnc 0:16 -device VGA,id=video0,vgamem_mb=16,bus=pci.0,addr=0x5 \
-msg timestamp=on \
-netdev tap,id=hostnet0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:c4:e7:93,bus=pci.0,addr=0x6 \
-qmp tcp:0:4448,server,nowait \

Comment 3 Thomas Huth 2016-01-18 14:52:29 UTC
Does this only happen on ppc64? i.e. did you try it on x86_64, too?

Comment 4 Zhengtong 2016-01-20 05:15:24 UTC
(In reply to Thomas Huth from comment #3)
> Does this only happen on ppc64? i.e. did you try it on x86_64, too?

Yes , it works well on X86.

Comment 5 Thomas Huth 2016-01-20 11:20:02 UTC
Ok, I've just tried it with qemu-kvm-rhev-2.3.0-31.el7_2.5.ppc64le, and I was not able to reproduce this problem. The mirror.raw had the right size. Zhengtong, could you please try whether you can still reproduce this problem with the latest version of qemu-kvm-rhev on ppc64le? Also, is there any output from QEMU? For me it says something like:
 Formatting '/root/test_home/liuzt/vdisk/mirror.raw', fmt=raw size=10739318784
when I issue the QMP command. Do you get a similar message or maybe even an error message?

Comment 6 Zhengtong 2016-01-21 02:49:33 UTC
Hi , Thomas , the bug seems fixed already in some versions before. I can't reproduce it any more , either. The qemu message is "Formatting '/root/test_home/liuzt/vdisk/mirror.raw', fmt=raw size=21474836480",  After the process finished , the size if normal (1.5G in my test). So this bug could be closed.

Comment 7 Thomas Huth 2016-01-21 07:20:10 UTC
Ok, closing since it seems to be fixed in the current version already.