Bug 813953 - block-job-set-speed is racy with block-stream/drive-mirror
block-job-set-speed is racy with block-stream/drive-mirror
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
All Linux
medium Severity medium
: rc
: 6.3
Assigned To: Jeff Cody
Virtualization Bugs
Depends On: 582475 783950 812085
Blocks: 525307 580954 638506 638508 638509 748534 756082 769496 786141 799055 802284 806280 806432 811683 815791 830861 831532 835344 835345 835722 865384
  Show dependency treegraph
Reported: 2012-04-18 16:39 EDT by Eric Blake
Modified: 2013-01-09 19:53 EST (History)
30 users (show)

See Also:
Fixed In Version: qemu-kvm-
Doc Type: Bug Fix
Doc Text:
No Documentation Needed
Story Points: ---
Clone Of: 812085
Last Closed: 2012-06-20 07:47:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Comment 1 Shaolong Hu 2012-04-18 22:50:52 EDT
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-18 23:25:11 EDT
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 10:28:50 EDT
v2 of upstream patch proposal:

- 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 10:31:06 EDT
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 11:58:04 EDT
Posted to rhvirt
Comment 12 Michal Novotny 2012-05-04 09:31:48 EDT
    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 02:58:05 EDT
Verified on qemu-kvm-rhev-

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-", "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-", "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-", "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 00:38:28 EDT
Moving to VERIFIED as per Comment #2 and Comment #13
Comment 15 Shaolong Hu 2012-05-23 06:06:10 EDT
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 07:47:01 EDT
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.


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