xref: /qemu/include/hw/virtio/vhost-user-blk.h (revision 00343e4b54ba0685e9ebe928ec5713b0cf7f1d1c)
1*00343e4bSChangpeng Liu /*
2*00343e4bSChangpeng Liu  * vhost-user-blk host device
3*00343e4bSChangpeng Liu  * Copyright(C) 2017 Intel Corporation.
4*00343e4bSChangpeng Liu  *
5*00343e4bSChangpeng Liu  * Authors:
6*00343e4bSChangpeng Liu  *  Changpeng Liu <changpeng.liu@intel.com>
7*00343e4bSChangpeng Liu  *
8*00343e4bSChangpeng Liu  * Based on vhost-scsi.h, Copyright IBM, Corp. 2011
9*00343e4bSChangpeng Liu  *
10*00343e4bSChangpeng Liu  * This work is licensed under the terms of the GNU LGPL, version 2 or later.
11*00343e4bSChangpeng Liu  * See the COPYING.LIB file in the top-level directory.
12*00343e4bSChangpeng Liu  *
13*00343e4bSChangpeng Liu  */
14*00343e4bSChangpeng Liu 
15*00343e4bSChangpeng Liu #ifndef VHOST_USER_BLK_H
16*00343e4bSChangpeng Liu #define VHOST_USER_BLK_H
17*00343e4bSChangpeng Liu 
18*00343e4bSChangpeng Liu #include "standard-headers/linux/virtio_blk.h"
19*00343e4bSChangpeng Liu #include "qemu-common.h"
20*00343e4bSChangpeng Liu #include "hw/qdev.h"
21*00343e4bSChangpeng Liu #include "hw/block/block.h"
22*00343e4bSChangpeng Liu #include "chardev/char-fe.h"
23*00343e4bSChangpeng Liu #include "hw/virtio/vhost.h"
24*00343e4bSChangpeng Liu 
25*00343e4bSChangpeng Liu #define TYPE_VHOST_USER_BLK "vhost-user-blk"
26*00343e4bSChangpeng Liu #define VHOST_USER_BLK(obj) \
27*00343e4bSChangpeng Liu         OBJECT_CHECK(VHostUserBlk, (obj), TYPE_VHOST_USER_BLK)
28*00343e4bSChangpeng Liu 
29*00343e4bSChangpeng Liu typedef struct VHostUserBlk {
30*00343e4bSChangpeng Liu     VirtIODevice parent_obj;
31*00343e4bSChangpeng Liu     CharBackend chardev;
32*00343e4bSChangpeng Liu     int32_t bootindex;
33*00343e4bSChangpeng Liu     struct virtio_blk_config blkcfg;
34*00343e4bSChangpeng Liu     uint16_t num_queues;
35*00343e4bSChangpeng Liu     uint32_t queue_size;
36*00343e4bSChangpeng Liu     uint32_t config_wce;
37*00343e4bSChangpeng Liu     uint32_t config_ro;
38*00343e4bSChangpeng Liu     struct vhost_dev dev;
39*00343e4bSChangpeng Liu } VHostUserBlk;
40*00343e4bSChangpeng Liu 
41*00343e4bSChangpeng Liu #endif
42