Pradeep Jagadeesh | b8bbdb8 | 2017-02-28 10:31:46 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Fsdev Throttle |
| 3 | * |
| 4 | * Copyright (C) 2016 Huawei Technologies Duesseldorf GmbH |
| 5 | * |
| 6 | * Author: Pradeep Jagadeesh <pradeep.jagadeesh@huawei.com> |
| 7 | * |
| 8 | * This work is licensed under the terms of the GNU GPL, version 2 or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * See the COPYING file in the top-level directory for details. |
| 12 | * |
| 13 | */ |
| 14 | |
Markus Armbruster | 58ea30f | 2019-03-15 15:51:20 +0100 | [diff] [blame] | 15 | #ifndef QEMU_FSDEV_THROTTLE_H |
| 16 | #define QEMU_FSDEV_THROTTLE_H |
Pradeep Jagadeesh | b8bbdb8 | 2017-02-28 10:31:46 +0100 | [diff] [blame] | 17 | |
| 18 | #include "block/aio.h" |
Pradeep Jagadeesh | b8bbdb8 | 2017-02-28 10:31:46 +0100 | [diff] [blame] | 19 | #include "qemu/coroutine.h" |
Pradeep Jagadeesh | b8bbdb8 | 2017-02-28 10:31:46 +0100 | [diff] [blame] | 20 | #include "qemu/throttle.h" |
| 21 | |
| 22 | typedef struct FsThrottle { |
| 23 | ThrottleState ts; |
| 24 | ThrottleTimers tt; |
| 25 | ThrottleConfig cfg; |
| 26 | CoQueue throttled_reqs[2]; |
| 27 | } FsThrottle; |
| 28 | |
Greg Kurz | ea52cdd | 2019-10-10 11:36:05 +0200 | [diff] [blame] | 29 | int fsdev_throttle_parse_opts(QemuOpts *, FsThrottle *, Error **); |
Pradeep Jagadeesh | b8bbdb8 | 2017-02-28 10:31:46 +0100 | [diff] [blame] | 30 | |
| 31 | void fsdev_throttle_init(FsThrottle *); |
| 32 | |
| 33 | void coroutine_fn fsdev_co_throttle_request(FsThrottle *, bool , |
| 34 | struct iovec *, int); |
| 35 | |
| 36 | void fsdev_throttle_cleanup(FsThrottle *); |
Markus Armbruster | 58ea30f | 2019-03-15 15:51:20 +0100 | [diff] [blame] | 37 | |
| 38 | #endif /* QEMU_FSDEV_THROTTLE_H */ |