diff options
author | Max Reitz <mreitz@redhat.com> | 2015-10-19 17:53:23 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2015-10-23 18:18:23 +0200 |
commit | 973f2ddf7b48c27aa8642047796cca3bec0b48d8 (patch) | |
tree | 159ea895abcbe825e9d42c227b25129106e5372f /include/block | |
parent | 373340b26caa1572cf0f155131569dfc527aa133 (diff) | |
download | hqemu-973f2ddf7b48c27aa8642047796cca3bec0b48d8.zip hqemu-973f2ddf7b48c27aa8642047796cca3bec0b48d8.tar.gz |
block/throttle-groups: Make incref/decref public
Throttle groups are not necessarily referenced by BDSs alone; a later
patch will essentially allow BBs to reference them, too. Make the
ref/unref functions public so that reference can be properly accounted
for.
Their interface is slightly adjusted in that they return and take a
ThrottleState pointer, respectively, instead of a ThrottleGroup pointer.
Functionally, they are equivalent, but since ThrottleGroup is not meant
to be used outside of block/throttle-groups.c, ThrottleState is easier
to handle.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r-- | include/block/throttle-groups.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/block/throttle-groups.h b/include/block/throttle-groups.h index fab113f..f3b75b3 100644 --- a/include/block/throttle-groups.h +++ b/include/block/throttle-groups.h @@ -30,6 +30,9 @@ const char *throttle_group_get_name(BlockDriverState *bs); +ThrottleState *throttle_group_incref(const char *name); +void throttle_group_unref(ThrottleState *ts); + void throttle_group_config(BlockDriverState *bs, ThrottleConfig *cfg); void throttle_group_get_config(BlockDriverState *bs, ThrottleConfig *cfg); |