
Read only feature shouldn't be negotiable, because if the backend device reported Read only feature supported, QEMU host driver shouldn't change backend's RO attribute. While here, also enable the vhost-user-blk test utility to test RO feature. Signed-off-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
43 lines
1.0 KiB
C
43 lines
1.0 KiB
C
/*
|
|
* vhost-user-blk host device
|
|
* Copyright(C) 2017 Intel Corporation.
|
|
*
|
|
* Authors:
|
|
* Changpeng Liu <changpeng.liu@intel.com>
|
|
*
|
|
* Based on vhost-scsi.h, Copyright IBM, Corp. 2011
|
|
*
|
|
* This work is licensed under the terms of the GNU LGPL, version 2 or later.
|
|
* See the COPYING.LIB file in the top-level directory.
|
|
*
|
|
*/
|
|
|
|
#ifndef VHOST_USER_BLK_H
|
|
#define VHOST_USER_BLK_H
|
|
|
|
#include "standard-headers/linux/virtio_blk.h"
|
|
#include "qemu-common.h"
|
|
#include "hw/qdev.h"
|
|
#include "hw/block/block.h"
|
|
#include "chardev/char-fe.h"
|
|
#include "hw/virtio/vhost.h"
|
|
#include "hw/virtio/vhost-user.h"
|
|
|
|
#define TYPE_VHOST_USER_BLK "vhost-user-blk"
|
|
#define VHOST_USER_BLK(obj) \
|
|
OBJECT_CHECK(VHostUserBlk, (obj), TYPE_VHOST_USER_BLK)
|
|
|
|
typedef struct VHostUserBlk {
|
|
VirtIODevice parent_obj;
|
|
CharBackend chardev;
|
|
int32_t bootindex;
|
|
struct virtio_blk_config blkcfg;
|
|
uint16_t num_queues;
|
|
uint32_t queue_size;
|
|
uint32_t config_wce;
|
|
struct vhost_dev dev;
|
|
VhostUserState *vhost_user;
|
|
} VHostUserBlk;
|
|
|
|
#endif
|