blob: 7d6211d49910a0874ee55e1384a555e451cef8a8 [file] [log] [blame]
Pradeep Jagadeeshb8bbdb82017-02-28 10:31:46 +01001/*
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 Armbruster58ea30f2019-03-15 15:51:20 +010015#ifndef QEMU_FSDEV_THROTTLE_H
16#define QEMU_FSDEV_THROTTLE_H
Pradeep Jagadeeshb8bbdb82017-02-28 10:31:46 +010017
18#include "block/aio.h"
19#include "qemu/main-loop.h"
20#include "qemu/coroutine.h"
Pradeep Jagadeeshb8bbdb82017-02-28 10:31:46 +010021#include "qemu/throttle.h"
22
23typedef struct FsThrottle {
24 ThrottleState ts;
25 ThrottleTimers tt;
26 ThrottleConfig cfg;
27 CoQueue throttled_reqs[2];
28} FsThrottle;
29
30void fsdev_throttle_parse_opts(QemuOpts *, FsThrottle *, Error **);
31
32void fsdev_throttle_init(FsThrottle *);
33
34void coroutine_fn fsdev_co_throttle_request(FsThrottle *, bool ,
35 struct iovec *, int);
36
37void fsdev_throttle_cleanup(FsThrottle *);
Markus Armbruster58ea30f2019-03-15 15:51:20 +010038
39#endif /* QEMU_FSDEV_THROTTLE_H */