block.h (3180aadb1f00fa0f0b47bccbcae5b1d47dc5ff74) block.h (892b7de832681cdfff22a6e96cb0280b59684024)
1#ifndef BLOCK_H
2#define BLOCK_H
3
4#include "block/aio.h"
5#include "qemu-common.h"
6#include "qemu/option.h"
7#include "block/coroutine.h"
8#include "block/accounting.h"

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

55 * is allowed to optimize a write zeroes request by unmapping (discarding)
56 * blocks if it is guaranteed that the result will read back as
57 * zeroes. The flag is only passed to the driver if the block device is
58 * opened with BDRV_O_UNMAP.
59 */
60 BDRV_REQ_MAY_UNMAP = 0x4,
61} BdrvRequestFlags;
62
1#ifndef BLOCK_H
2#define BLOCK_H
3
4#include "block/aio.h"
5#include "qemu-common.h"
6#include "qemu/option.h"
7#include "block/coroutine.h"
8#include "block/accounting.h"

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

55 * is allowed to optimize a write zeroes request by unmapping (discarding)
56 * blocks if it is guaranteed that the result will read back as
57 * zeroes. The flag is only passed to the driver if the block device is
58 * opened with BDRV_O_UNMAP.
59 */
60 BDRV_REQ_MAY_UNMAP = 0x4,
61} BdrvRequestFlags;
62
63typedef struct BlockSizes {
64 uint32_t phys;
65 uint32_t log;
66} BlockSizes;
67
68typedef struct HDGeometry {
69 uint32_t heads;
70 uint32_t sectors;
71 uint32_t cylinders;
72} HDGeometry;
73
63#define BDRV_O_RDWR 0x0002
64#define BDRV_O_SNAPSHOT 0x0008 /* open the file read only and save writes in a snapshot */
65#define BDRV_O_TEMPORARY 0x0010 /* delete the file after use */
66#define BDRV_O_NOCACHE 0x0020 /* do not use the host page cache */
67#define BDRV_O_CACHE_WB 0x0040 /* use write-back caching */
68#define BDRV_O_NATIVE_AIO 0x0080 /* use native AIO instead of the thread pool */
69#define BDRV_O_NO_BACKING 0x0100 /* don't open the backing file */
70#define BDRV_O_NO_FLUSH 0x0200 /* disable flushing on this disk */

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

545 * bdrv_set_aio_context:
546 *
547 * Changes the #AioContext used for fd handlers, timers, and BHs by this
548 * BlockDriverState and all its children.
549 *
550 * This function must be called with iothread lock held.
551 */
552void bdrv_set_aio_context(BlockDriverState *bs, AioContext *new_context);
74#define BDRV_O_RDWR 0x0002
75#define BDRV_O_SNAPSHOT 0x0008 /* open the file read only and save writes in a snapshot */
76#define BDRV_O_TEMPORARY 0x0010 /* delete the file after use */
77#define BDRV_O_NOCACHE 0x0020 /* do not use the host page cache */
78#define BDRV_O_CACHE_WB 0x0040 /* use write-back caching */
79#define BDRV_O_NATIVE_AIO 0x0080 /* use native AIO instead of the thread pool */
80#define BDRV_O_NO_BACKING 0x0100 /* don't open the backing file */
81#define BDRV_O_NO_FLUSH 0x0200 /* disable flushing on this disk */

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

556 * bdrv_set_aio_context:
557 *
558 * Changes the #AioContext used for fd handlers, timers, and BHs by this
559 * BlockDriverState and all its children.
560 *
561 * This function must be called with iothread lock held.
562 */
563void bdrv_set_aio_context(BlockDriverState *bs, AioContext *new_context);
564int bdrv_probe_blocksizes(BlockDriverState *bs, BlockSizes *bsz);
565int bdrv_probe_geometry(BlockDriverState *bs, HDGeometry *geo);
553
554void bdrv_io_plug(BlockDriverState *bs);
555void bdrv_io_unplug(BlockDriverState *bs);
556void bdrv_flush_io_queue(BlockDriverState *bs);
557
558BlockAcctStats *bdrv_get_stats(BlockDriverState *bs);
559
560#endif
566
567void bdrv_io_plug(BlockDriverState *bs);
568void bdrv_io_unplug(BlockDriverState *bs);
569void bdrv_flush_io_queue(BlockDriverState *bs);
570
571BlockAcctStats *bdrv_get_stats(BlockDriverState *bs);
572
573#endif