summaryrefslogtreecommitdiff
path: root/hmp.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 /hmp.c
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 'hmp.c')
-rw-r--r--hmp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hmp.c b/hmp.c
index f3e5163f1e..eb96618e1e 100644
--- a/hmp.c
+++ b/hmp.c
@@ -835,8 +835,10 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict)
Error *error = NULL;
const char *device = qdict_get_str(qdict, "device");
const char *base = qdict_get_try_str(qdict, "base");
+ int64_t speed = qdict_get_try_int(qdict, "speed", 0);
- qmp_block_stream(device, base != NULL, base, &error);
+ qmp_block_stream(device, base != NULL, base,
+ qdict_haskey(qdict, "speed"), speed, &error);
hmp_handle_error(mon, &error);
}