qemu/block/coroutines.h
<<
>>
Prefs
   1/*
   2 * Block layer I/O functions
   3 *
   4 * Copyright (c) 2003 Fabrice Bellard
   5 *
   6 * Permission is hereby granted, free of charge, to any person obtaining a copy
   7 * of this software and associated documentation files (the "Software"), to deal
   8 * in the Software without restriction, including without limitation the rights
   9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10 * copies of the Software, and to permit persons to whom the Software is
  11 * furnished to do so, subject to the following conditions:
  12 *
  13 * The above copyright notice and this permission notice shall be included in
  14 * all copies or substantial portions of the Software.
  15 *
  16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22 * THE SOFTWARE.
  23 */
  24
  25#ifndef BLOCK_COROUTINES_INT_H
  26#define BLOCK_COROUTINES_INT_H
  27
  28#include "block/block_int.h"
  29
  30/* For blk_bs() in generated block/block-gen.c */
  31#include "sysemu/block-backend.h"
  32
  33int coroutine_fn bdrv_co_check(BlockDriverState *bs,
  34                               BdrvCheckResult *res, BdrvCheckMode fix);
  35int coroutine_fn bdrv_co_invalidate_cache(BlockDriverState *bs, Error **errp);
  36
  37int generated_co_wrapper
  38bdrv_preadv(BdrvChild *child, int64_t offset, unsigned int bytes,
  39            QEMUIOVector *qiov, BdrvRequestFlags flags);
  40int generated_co_wrapper
  41bdrv_pwritev(BdrvChild *child, int64_t offset, unsigned int bytes,
  42             QEMUIOVector *qiov, BdrvRequestFlags flags);
  43
  44int coroutine_fn
  45bdrv_co_common_block_status_above(BlockDriverState *bs,
  46                                  BlockDriverState *base,
  47                                  bool include_base,
  48                                  bool want_zero,
  49                                  int64_t offset,
  50                                  int64_t bytes,
  51                                  int64_t *pnum,
  52                                  int64_t *map,
  53                                  BlockDriverState **file,
  54                                  int *depth);
  55int generated_co_wrapper
  56bdrv_common_block_status_above(BlockDriverState *bs,
  57                               BlockDriverState *base,
  58                               bool include_base,
  59                               bool want_zero,
  60                               int64_t offset,
  61                               int64_t bytes,
  62                               int64_t *pnum,
  63                               int64_t *map,
  64                               BlockDriverState **file,
  65                               int *depth);
  66
  67int coroutine_fn bdrv_co_readv_vmstate(BlockDriverState *bs,
  68                                       QEMUIOVector *qiov, int64_t pos);
  69int coroutine_fn bdrv_co_writev_vmstate(BlockDriverState *bs,
  70                                        QEMUIOVector *qiov, int64_t pos);
  71
  72int generated_co_wrapper
  73nbd_do_establish_connection(BlockDriverState *bs, Error **errp);
  74int coroutine_fn
  75nbd_co_do_establish_connection(BlockDriverState *bs, Error **errp);
  76
  77
  78int generated_co_wrapper
  79blk_do_preadv(BlockBackend *blk, int64_t offset, int64_t bytes,
  80              QEMUIOVector *qiov, BdrvRequestFlags flags);
  81int coroutine_fn
  82blk_co_do_preadv(BlockBackend *blk, int64_t offset, int64_t bytes,
  83                 QEMUIOVector *qiov, BdrvRequestFlags flags);
  84
  85
  86int generated_co_wrapper
  87blk_do_pwritev_part(BlockBackend *blk, int64_t offset, int64_t bytes,
  88                    QEMUIOVector *qiov, size_t qiov_offset,
  89                    BdrvRequestFlags flags);
  90int coroutine_fn
  91blk_co_do_pwritev_part(BlockBackend *blk, int64_t offset, int64_t bytes,
  92                       QEMUIOVector *qiov, size_t qiov_offset,
  93                       BdrvRequestFlags flags);
  94
  95int generated_co_wrapper
  96blk_do_ioctl(BlockBackend *blk, unsigned long int req, void *buf);
  97int coroutine_fn
  98blk_co_do_ioctl(BlockBackend *blk, unsigned long int req, void *buf);
  99
 100int generated_co_wrapper
 101blk_do_pdiscard(BlockBackend *blk, int64_t offset, int64_t bytes);
 102int coroutine_fn
 103blk_co_do_pdiscard(BlockBackend *blk, int64_t offset, int64_t bytes);
 104
 105int generated_co_wrapper blk_do_flush(BlockBackend *blk);
 106int coroutine_fn blk_co_do_flush(BlockBackend *blk);
 107
 108#endif /* BLOCK_COROUTINES_INT_H */
 109