aboutsummaryrefslogtreecommitdiff
path: root/block/stream.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2012-04-25 16:51:03 +0100
committerLuiz Capitulino <lcapitulino@redhat.com>2012-04-27 11:44:50 -0300
commitc83c66c3b58893a4dc056e272822beb88fe9ec7f (patch)
tree890e9af2cbfef523b48c365df64820e96445185a /block/stream.c
parent882ec7ce531091bc0f3ffc6ac71943cf383f86a6 (diff)
downloadqemu-c83c66c3b58893a4dc056e272822beb88fe9ec7f.zip
qemu-c83c66c3b58893a4dc056e272822beb88fe9ec7f.tar.gz
qemu-c83c66c3b58893a4dc056e272822beb88fe9ec7f.tar.bz2
block: add 'speed' optional parameter to block-stream
Allow streaming operations to be started with an initial speed limit. This eliminates the window of time between starting streaming and issuing block-job-set-speed. Users should use the new optional 'speed' parameter instead so that speed limits are in effect immediately when the job starts. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'block/stream.c')
-rw-r--r--block/stream.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/stream.c b/block/stream.c
index b66242a..6724af2 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -281,13 +281,14 @@ static BlockJobType stream_job_type = {
};
void stream_start(BlockDriverState *bs, BlockDriverState *base,
- const char *base_id, BlockDriverCompletionFunc *cb,
+ const char *base_id, int64_t speed,
+ BlockDriverCompletionFunc *cb,
void *opaque, Error **errp)
{
StreamBlockJob *s;
Coroutine *co;
- s = block_job_create(&stream_job_type, bs, cb, opaque, errp);
+ s = block_job_create(&stream_job_type, bs, speed, cb, opaque, errp);
if (!s) {
return;
}