Bug 813953

Summary: block-job-set-speed is racy with block-stream/drive-mirror
Product: Red Hat Enterprise Linux 6 Reporter: Eric Blake <eblake>
Component: qemu-kvmAssignee: Jeff Cody <jcody>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: abaron, acathrow, ajia, areis, bazulay, berrange, bsarathy, bugproxy, chayang, djuran, dyasny, eblake, fosborne, gcosta, iheim, juzhang, kirbyzhou, michen, minovotn, mkenneth, mzhan, pbonzini, rwu, shu, sluo, syeghiay, tburke, virt-maint, weizhan, whuang
Target Milestone: rc   
Target Release: 6.3   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.290.el6 Doc Type: Bug Fix
Doc Text:
No Documentation Needed
Story Points: ---
Clone Of: 812085 Environment:
Last Closed: 2012-06-20 11:47:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 582475, 783950, 812085    
Bug Blocks: 525307, 580954, 638506, 638508, 638509, 748534, 756082, 769496, 786141, 799055, 802284, 806280, 806432, 811683, 815791, 830861, 831532, 835344, 835345, 835722, 865384    

Comment 1 Shaolong Hu 2012-04-19 02:50:52 UTC
how about implement block_stream and block-job-set-speed in transaction? Then a block_stream + block-job-set-speed or __com.redhat.drive-mirror + block-job-set-speed transaction should work.

Comment 2 juzhang 2012-04-19 03:25:11 UTC
According to bug description, qe can reproduce with qemu-kvm-rhev-278,mark qa_ack+
(qemu) block-job-set-speed ide1-cd0 1M
Device 'ide1-cd0' has not been activated by the guest

Comment 6 Eric Blake 2012-04-24 14:28:50 UTC
v2 of upstream patch proposal:
https://lists.gnu.org/archive/html/qemu-devel/2012-04/msg03510.html

- change block-job-set-speed to use parameter name 'speed' instead of 'value'
- add optional 'speed' parameter to 'block-stream'
- add optional 'speed' parameter to '__com.redhat_drive-mirror'

Comment 7 Eric Blake 2012-04-24 14:31:06 UTC
Updating the title; the upstream qemu solution appears to be headed towards setting the speed as part of starting a job, at which point it would still be an expected error to attempt to set the speed while a job is not running; the difference in verification would be checking that the optional parameter is present when starting the job and setting speed in one monitor call rather than the current constraint of two separate calls.

Comment 9 Jeff Cody 2012-05-01 15:58:04 UTC
Posted to rhvirt

Comment 12 Michal Novotny 2012-05-04 13:31:48 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No Documentation Needed

Comment 13 Shaolong Hu 2012-05-17 06:58:05 UTC
Verified on qemu-kvm-rhev-0.12.1.2-2.292.el6.x86_64:

1. mirroring with speed set to 10M at beginning, after steady state, reopen to target, reboot guest, guest works correctly:

{ "execute" : "__com.redhat_drive-mirror", "arguments" : { "device" : "drive-virtio-disk0", "target" : "/dev/disk/by-path/ip-10.66.9.64:3260-iscsi-iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz-lun-2", "format": "qcow2", "mode": "absolute-paths", "speed": 10485760, "full" : false } }
{"return": {}}

{ "execute": "__com.redhat_drive-reopen", "arguments": {"device": "drive-virtio-disk0", "new-image-file": "/dev/disk/by-path/ip-10.66.9.64:3260-iscsi-iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz-lun-2", "format": "qcow2" } }
{"timestamp": {"seconds": 1337189124, "microseconds": 258318}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "drive-virtio-disk0", "len": 21474836480, "offset": 21474836480, "speed": 109951162777600, "type": "mirror"}}
{"return": {}}

2. streaming with speed set to 10M

{ "execute": "blockdev-snapshot-sync", "arguments": { "device": "drive-virtio-disk0", "snapshot-file": "/dev/disk/by-path/ip-10.66.9.64:3260-iscsi-iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz-lun-2", "mode": "absolute-paths", "format": "qcow2" } }
{"return": {}}

{ "execute": "block-stream", "arguments": { "device": "drive-virtio-disk0", "speed": 10485760 } }
{"return": {}}

{"timestamp": {"seconds": 1337265302, "microseconds": 451952}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "drive-virtio-disk0", "len": 21474836480, "offset": 21474836480, "speed": 1099511627776000, "type": "stream"}}


Based on above results, fixed.

Comment 14 Chao Yang 2012-05-18 04:38:28 UTC
Moving to VERIFIED as per Comment #2 and Comment #13

Comment 15 Shaolong Hu 2012-05-23 10:06:10 UTC
Doc has not been modified, open new one to track:
Bug 824338 - invalid argument in block-job-set-speed document

Comment 16 errata-xmlrpc 2012-06-20 11:47:01 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.

http://rhn.redhat.com/errata/RHBA-2012-0746.html