ppc/pnv: add PHB3 bus init helper
[qemu.git] / block / export / virtio-blk-handler.h
blob150d44cff249f45d6f89eac43969f40fcd0d3028
1 /*
2 * Handler for virtio-blk I/O
4 * Copyright (C) 2022 Bytedance Inc. and/or its affiliates. All rights reserved.
6 * Author:
7 * Xie Yongji <xieyongji@bytedance.com>
9 * This work is licensed under the terms of the GNU GPL, version 2 or
10 * later. See the COPYING file in the top-level directory.
13 #ifndef VIRTIO_BLK_HANDLER_H
14 #define VIRTIO_BLK_HANDLER_H
16 #include "sysemu/block-backend.h"
18 #define VIRTIO_BLK_SECTOR_BITS 9
19 #define VIRTIO_BLK_SECTOR_SIZE (1ULL << VIRTIO_BLK_SECTOR_BITS)
21 #define VIRTIO_BLK_MAX_DISCARD_SECTORS 32768
22 #define VIRTIO_BLK_MAX_WRITE_ZEROES_SECTORS 32768
24 typedef struct {
25 BlockBackend *blk;
26 char *serial;
27 uint32_t logical_block_size;
28 bool writable;
29 } VirtioBlkHandler;
31 int coroutine_fn virtio_blk_process_req(VirtioBlkHandler *handler,
32 struct iovec *in_iov,
33 struct iovec *out_iov,
34 unsigned int in_num,
35 unsigned int out_num);
37 #endif /* VIRTIO_BLK_HANDLER_H */