aboutsummaryrefslogtreecommitdiff
path: root/block_int.h
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_int.h
parent882ec7ce531091bc0f3ffc6ac71943cf383f86a6 (diff)
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_int.h')
-rw-r--r--block_int.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/block_int.h b/block_int.h
index 624b2e634c..086832aab9 100644
--- a/block_int.h
+++ b/block_int.h
@@ -344,6 +344,7 @@ int is_windows_drive(const char *filename);
* block_job_create:
* @job_type: The class object for the newly-created job.
* @bs: The block
+ * @speed: The maximum speed, in bytes per second, or 0 for unlimited.
* @cb: Completion function for the job.
* @opaque: Opaque pointer value passed to @cb.
* @errp: Error object.
@@ -358,8 +359,8 @@ int is_windows_drive(const char *filename);
* called from a wrapper that is specific to the job type.
*/
void *block_job_create(const BlockJobType *job_type, BlockDriverState *bs,
- BlockDriverCompletionFunc *cb, void *opaque,
- Error **errp);
+ int64_t speed, BlockDriverCompletionFunc *cb,
+ void *opaque, Error **errp);
/**
* block_job_complete:
@@ -418,6 +419,7 @@ void block_job_cancel_sync(BlockJob *job);
* flatten the whole backing file chain onto @bs.
* @base_id: The file name that will be written to @bs as the new
* backing file if the job completes. Ignored if @base is %NULL.
+ * @speed: The maximum speed, in bytes per second, or 0 for unlimited.
* @cb: Completion function for the job.
* @opaque: Opaque pointer value passed to @cb.
* @errp: Error object.
@@ -429,7 +431,8 @@ void block_job_cancel_sync(BlockJob *job);
* @base_id in the written image and to @base in the live BlockDriverState.
*/
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);
#endif /* BLOCK_INT_H */