throttle.c (fcb7e040f5c69ca1f0678f991ab5354488a9e192) throttle.c (c86422c5549c0983b4b4525b8f56a1c69dd67aa1)
1/*
2 * QEMU block throttling filter driver infrastructure
3 *
4 * Copyright (c) 2017 Manos Pitsidianakis
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 or

--- 92 unchanged lines hidden (view full) ---

101
102static void throttle_close(BlockDriverState *bs)
103{
104 ThrottleGroupMember *tgm = bs->opaque;
105 throttle_group_unregister_tgm(tgm);
106}
107
108
1/*
2 * QEMU block throttling filter driver infrastructure
3 *
4 * Copyright (c) 2017 Manos Pitsidianakis
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 or

--- 92 unchanged lines hidden (view full) ---

101
102static void throttle_close(BlockDriverState *bs)
103{
104 ThrottleGroupMember *tgm = bs->opaque;
105 throttle_group_unregister_tgm(tgm);
106}
107
108
109static int64_t throttle_getlength(BlockDriverState *bs)
109static int64_t coroutine_fn throttle_co_getlength(BlockDriverState *bs)
110{
110{
111 return bdrv_getlength(bs->file->bs);
111 return bdrv_co_getlength(bs->file->bs);
112}
113
114static int coroutine_fn throttle_co_preadv(BlockDriverState *bs,
115 int64_t offset, int64_t bytes,
116 QEMUIOVector *qiov,
117 BdrvRequestFlags flags)
118{
119

--- 122 unchanged lines hidden (view full) ---

242 .instance_size = sizeof(ThrottleGroupMember),
243
244 .bdrv_open = throttle_open,
245 .bdrv_close = throttle_close,
246 .bdrv_co_flush = throttle_co_flush,
247
248 .bdrv_child_perm = bdrv_default_perms,
249
112}
113
114static int coroutine_fn throttle_co_preadv(BlockDriverState *bs,
115 int64_t offset, int64_t bytes,
116 QEMUIOVector *qiov,
117 BdrvRequestFlags flags)
118{
119

--- 122 unchanged lines hidden (view full) ---

242 .instance_size = sizeof(ThrottleGroupMember),
243
244 .bdrv_open = throttle_open,
245 .bdrv_close = throttle_close,
246 .bdrv_co_flush = throttle_co_flush,
247
248 .bdrv_child_perm = bdrv_default_perms,
249
250 .bdrv_getlength = throttle_getlength,
250 .bdrv_co_getlength = throttle_co_getlength,
251
252 .bdrv_co_preadv = throttle_co_preadv,
253 .bdrv_co_pwritev = throttle_co_pwritev,
254
255 .bdrv_co_pwrite_zeroes = throttle_co_pwrite_zeroes,
256 .bdrv_co_pdiscard = throttle_co_pdiscard,
257 .bdrv_co_pwritev_compressed = throttle_co_pwritev_compressed,
258

--- 20 unchanged lines hidden ---
251
252 .bdrv_co_preadv = throttle_co_preadv,
253 .bdrv_co_pwritev = throttle_co_pwritev,
254
255 .bdrv_co_pwrite_zeroes = throttle_co_pwrite_zeroes,
256 .bdrv_co_pdiscard = throttle_co_pdiscard,
257 .bdrv_co_pwritev_compressed = throttle_co_pwritev_compressed,
258

--- 20 unchanged lines hidden ---