aboutsummaryrefslogtreecommitdiff
path: root/hmp.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2012-01-18 14:40:47 +0000
committerKevin Wolf <kwolf@redhat.com>2012-01-26 14:49:17 +0100
commit2d47c6e9aa2475807913bd46dfca55980cca9fb4 (patch)
tree24c53c3bf120c063fc6ab0da03de7c715fe77138 /hmp.c
parent12bd451fe0be83474910bb63b5874458141d4230 (diff)
qmp: add block_job_set_speed command
Add block_job_set_speed, which sets the maximum speed for a background block operation. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hmp.c')
-rw-r--r--hmp.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hmp.c b/hmp.c
index cde8d7a5cb..bf3d9df88f 100644
--- a/hmp.c
+++ b/hmp.c
@@ -794,3 +794,14 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict)
hmp_handle_error(mon, &error);
}
+
+void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict)
+{
+ Error *error = NULL;
+ const char *device = qdict_get_str(qdict, "device");
+ int64_t value = qdict_get_int(qdict, "value");
+
+ qmp_block_job_set_speed(device, value, &error);
+
+ hmp_handle_error(mon, &error);
+}