virtio-blk: move qdev properties into virtio-blk.c
There is no need to make DEFINE_VIRTIO_BLK_PROPERTIES() public. Inline it into virtio-blk.c so it cannot be used by mistake from other source files. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
This commit is contained in:
parent
c5d49db446
commit
32a877e405
@ -785,7 +785,17 @@ static void virtio_blk_device_unrealize(DeviceState *dev, Error **errp)
|
||||
}
|
||||
|
||||
static Property virtio_blk_properties[] = {
|
||||
DEFINE_VIRTIO_BLK_PROPERTIES(VirtIOBlock, blk),
|
||||
DEFINE_BLOCK_PROPERTIES(VirtIOBlock, blk.conf),
|
||||
DEFINE_BLOCK_CHS_PROPERTIES(VirtIOBlock, blk.conf),
|
||||
DEFINE_PROP_STRING("serial", VirtIOBlock, blk.serial),
|
||||
DEFINE_PROP_BIT("config-wce", VirtIOBlock, blk.config_wce, 0, true),
|
||||
DEFINE_PROP_IOTHREAD("x-iothread", VirtIOBlock, blk.iothread),
|
||||
#ifdef __linux__
|
||||
DEFINE_PROP_BIT("scsi", VirtIOBlock, blk.scsi, 0, true),
|
||||
#endif
|
||||
#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE
|
||||
DEFINE_PROP_BIT("x-data-plane", VirtIOBlock, blk.data_plane, 0, false),
|
||||
#endif
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
|
@ -155,29 +155,6 @@ typedef struct VirtIOBlockReq {
|
||||
#define DEFINE_VIRTIO_BLK_FEATURES(_state, _field) \
|
||||
DEFINE_VIRTIO_COMMON_FEATURES(_state, _field)
|
||||
|
||||
#ifdef __linux__
|
||||
#define DEFINE_VIRTIO_BLK_PROPERTIES_LINUX(_state, _field) \
|
||||
DEFINE_PROP_BIT("scsi", _state, _field.scsi, 0, true),
|
||||
#else
|
||||
#define DEFINE_VIRTIO_BLK_PROPERTIES_LINUX(_state, _field)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE
|
||||
#define DEFINE_VIRTIO_BLK_PROPERTIES_DATA_PLANE(_state, _field) \
|
||||
DEFINE_PROP_BIT("x-data-plane", _state, _field.data_plane, 0, false),
|
||||
#else
|
||||
#define DEFINE_VIRTIO_BLK_PROPERTIES_DATA_PLANE(_state, _field)
|
||||
#endif
|
||||
|
||||
#define DEFINE_VIRTIO_BLK_PROPERTIES(_state, _field) \
|
||||
DEFINE_VIRTIO_BLK_PROPERTIES_LINUX(_state, _field) \
|
||||
DEFINE_VIRTIO_BLK_PROPERTIES_DATA_PLANE(_state, _field) \
|
||||
DEFINE_BLOCK_PROPERTIES(_state, _field.conf), \
|
||||
DEFINE_BLOCK_CHS_PROPERTIES(_state, _field.conf), \
|
||||
DEFINE_PROP_STRING("serial", _state, _field.serial), \
|
||||
DEFINE_PROP_BIT("config-wce", _state, _field.config_wce, 0, true), \
|
||||
DEFINE_PROP_IOTHREAD("x-iothread", _state, _field.iothread)
|
||||
|
||||
int virtio_blk_handle_scsi_req(VirtIOBlock *blk,
|
||||
VirtQueueElement *elem);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user