2015-06-08 19:17:42 +03:00
|
|
|
/*
|
|
|
|
* QEMU block throttling group infrastructure
|
|
|
|
*
|
|
|
|
* Copyright (C) Nodalink, EURL. 2014
|
|
|
|
* Copyright (C) Igalia, S.L. 2015
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Benoît Canet <benoit.canet@nodalink.com>
|
|
|
|
* Alberto Garcia <berto@igalia.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 or
|
|
|
|
* (at your option) version 3 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef THROTTLE_GROUPS_H
|
|
|
|
#define THROTTLE_GROUPS_H
|
|
|
|
|
|
|
|
#include "qemu/throttle.h"
|
|
|
|
#include "block/block_int.h"
|
|
|
|
|
2016-03-21 13:58:21 +03:00
|
|
|
const char *throttle_group_get_name(BlockBackend *blk);
|
2015-06-08 19:17:42 +03:00
|
|
|
|
2015-10-19 18:53:23 +03:00
|
|
|
ThrottleState *throttle_group_incref(const char *name);
|
|
|
|
void throttle_group_unref(ThrottleState *ts);
|
|
|
|
|
2016-03-21 15:53:52 +03:00
|
|
|
void throttle_group_config(BlockBackend *blk, ThrottleConfig *cfg);
|
|
|
|
void throttle_group_get_config(BlockBackend *blk, ThrottleConfig *cfg);
|
2015-06-08 19:17:42 +03:00
|
|
|
|
2016-03-21 13:30:57 +03:00
|
|
|
void throttle_group_register_blk(BlockBackend *blk, const char *groupname);
|
|
|
|
void throttle_group_unregister_blk(BlockBackend *blk);
|
2016-03-21 14:56:44 +03:00
|
|
|
void throttle_group_restart_blk(BlockBackend *blk);
|
2015-06-08 19:17:42 +03:00
|
|
|
|
2016-03-21 15:30:30 +03:00
|
|
|
void coroutine_fn throttle_group_co_io_limits_intercept(BlockBackend *blk,
|
2015-06-08 19:17:44 +03:00
|
|
|
unsigned int bytes,
|
|
|
|
bool is_write);
|
|
|
|
|
2015-06-08 19:17:42 +03:00
|
|
|
#endif
|