2
0

qemu-fsdev-throttle.h 941 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. #ifndef QEMU_FSDEV_THROTTLE_H
  15. #define QEMU_FSDEV_THROTTLE_H
  16. #include "block/aio.h"
  17. #include "qemu/coroutine.h"
  18. #include "qemu/throttle.h"
  19. typedef struct FsThrottle {
  20. ThrottleState ts;
  21. ThrottleTimers tt;
  22. ThrottleConfig cfg;
  23. CoQueue throttled_reqs[2];
  24. } FsThrottle;
  25. int fsdev_throttle_parse_opts(QemuOpts *, FsThrottle *, Error **);
  26. void fsdev_throttle_init(FsThrottle *);
  27. void coroutine_fn fsdev_co_throttle_request(FsThrottle *, bool ,
  28. struct iovec *, int);
  29. void fsdev_throttle_cleanup(FsThrottle *);
  30. #endif /* QEMU_FSDEV_THROTTLE_H */