summaryrefslogtreecommitdiffstats
path: root/include/block
diff options
context:
space:
mode:
authorManos Pitsidianakis2017-08-25 15:20:27 +0200
committerKevin Wolf2017-09-06 10:12:02 +0200
commitd8e7d87ec49c1458f516d50d109b3f201da736a1 (patch)
tree79513899899eac436824afc1108b64953acc0cc7 /include/block
parentblock: convert ThrottleGroup to object with QOM (diff)
downloadqemu-d8e7d87ec49c1458f516d50d109b3f201da736a1.tar.gz
qemu-d8e7d87ec49c1458f516d50d109b3f201da736a1.tar.xz
qemu-d8e7d87ec49c1458f516d50d109b3f201da736a1.zip
block: add throttle block filter driver
block/throttle.c uses existing I/O throttle infrastructure inside a block filter driver. I/O operations are intercepted in the filter's read/write coroutines, and referred to block/throttle-groups.c The driver can be used with the syntax -drive driver=throttle,file.filename=foo.qcow2,throttle-group=bar which registers the throttle filter node with the ThrottleGroup 'bar'. The given group must be created beforehand with object-add or -object. Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Manos Pitsidianakis <el13635@mail.ntua.gr> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/throttle-groups.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/block/throttle-groups.h b/include/block/throttle-groups.h
index 82f030523f..e2fd0513c4 100644
--- a/include/block/throttle-groups.h
+++ b/include/block/throttle-groups.h
@@ -76,5 +76,10 @@ void coroutine_fn throttle_group_co_io_limits_intercept(ThrottleGroupMember *tgm
void throttle_group_attach_aio_context(ThrottleGroupMember *tgm,
AioContext *new_context);
void throttle_group_detach_aio_context(ThrottleGroupMember *tgm);
+/*
+ * throttle_group_exists() must be called under the global
+ * mutex.
+ */
+bool throttle_group_exists(const char *name);
#endif