]> git.proxmox.com Git - mirror_qemu.git/blame - include/hw/virtio/vhost-user-blk.h
Use OBJECT_DECLARE_TYPE when possible
[mirror_qemu.git] / include / hw / virtio / vhost-user-blk.h
CommitLineData
00343e4b
CL
1/*
2 * vhost-user-blk host device
3 * Copyright(C) 2017 Intel Corporation.
4 *
5 * Authors:
6 * Changpeng Liu <changpeng.liu@intel.com>
7 *
8 * Based on vhost-scsi.h, Copyright IBM, Corp. 2011
9 *
10 * This work is licensed under the terms of the GNU LGPL, version 2 or later.
11 * See the COPYING.LIB file in the top-level directory.
12 *
13 */
14
15#ifndef VHOST_USER_BLK_H
16#define VHOST_USER_BLK_H
17
18#include "standard-headers/linux/virtio_blk.h"
00343e4b
CL
19#include "hw/block/block.h"
20#include "chardev/char-fe.h"
21#include "hw/virtio/vhost.h"
4d0cf552 22#include "hw/virtio/vhost-user.h"
db1015e9 23#include "qom/object.h"
00343e4b
CL
24
25#define TYPE_VHOST_USER_BLK "vhost-user-blk"
db1015e9 26typedef struct VHostUserBlk VHostUserBlk;
8110fa1d
EH
27DECLARE_INSTANCE_CHECKER(VHostUserBlk, VHOST_USER_BLK,
28 TYPE_VHOST_USER_BLK)
00343e4b 29
a4eef071
SH
30#define VHOST_USER_BLK_AUTO_NUM_QUEUES UINT16_MAX
31
db1015e9 32struct VHostUserBlk {
00343e4b
CL
33 VirtIODevice parent_obj;
34 CharBackend chardev;
35 int32_t bootindex;
36 struct virtio_blk_config blkcfg;
37 uint16_t num_queues;
38 uint32_t queue_size;
39 uint32_t config_wce;
00343e4b 40 struct vhost_dev dev;
a1fe0b8f 41 struct vhost_inflight *inflight;
0b99f224 42 VhostUserState vhost_user;
38e245a4
PN
43 struct vhost_virtqueue *vhost_vqs;
44 VirtQueue **virtqs;
77542d43 45 bool connected;
db1015e9 46};
00343e4b
CL
47
48#endif