mirror of https://github.com/xqemu/xqemu.git
vhost-user-scsi: move host_features into VHostSCSICommon
In preparation for having vhost-scsi also make use of host_features, move it from struct VHostUserSCSI into struct VHostSCSICommon. Signed-off-by: Greg Edwards <gedwards@ddn.com> Message-Id: <20180808195235.5843-2-gedwards@ddn.com> Reviewed-by: Felipe Franciosi <felipe@nutanix.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
f2a4ad6d49
commit
eb5757fcbe
|
@ -141,9 +141,10 @@ static uint64_t vhost_user_scsi_get_features(VirtIODevice *vdev,
|
||||||
uint64_t features, Error **errp)
|
uint64_t features, Error **errp)
|
||||||
{
|
{
|
||||||
VHostUserSCSI *s = VHOST_USER_SCSI(vdev);
|
VHostUserSCSI *s = VHOST_USER_SCSI(vdev);
|
||||||
|
VHostSCSICommon *vsc = VHOST_SCSI_COMMON(s);
|
||||||
|
|
||||||
/* Turn on predefined features supported by this device */
|
/* Turn on predefined features supported by this device */
|
||||||
features |= s->host_features;
|
features |= vsc->host_features;
|
||||||
|
|
||||||
return vhost_scsi_common_get_features(vdev, features, errp);
|
return vhost_scsi_common_get_features(vdev, features, errp);
|
||||||
}
|
}
|
||||||
|
@ -157,10 +158,10 @@ static Property vhost_user_scsi_properties[] = {
|
||||||
DEFINE_PROP_UINT32("max_sectors", VirtIOSCSICommon, conf.max_sectors,
|
DEFINE_PROP_UINT32("max_sectors", VirtIOSCSICommon, conf.max_sectors,
|
||||||
0xFFFF),
|
0xFFFF),
|
||||||
DEFINE_PROP_UINT32("cmd_per_lun", VirtIOSCSICommon, conf.cmd_per_lun, 128),
|
DEFINE_PROP_UINT32("cmd_per_lun", VirtIOSCSICommon, conf.cmd_per_lun, 128),
|
||||||
DEFINE_PROP_BIT64("hotplug", VHostUserSCSI, host_features,
|
DEFINE_PROP_BIT64("hotplug", VHostSCSICommon, host_features,
|
||||||
VIRTIO_SCSI_F_HOTPLUG,
|
VIRTIO_SCSI_F_HOTPLUG,
|
||||||
true),
|
true),
|
||||||
DEFINE_PROP_BIT64("param_change", VHostUserSCSI, host_features,
|
DEFINE_PROP_BIT64("param_change", VHostSCSICommon, host_features,
|
||||||
VIRTIO_SCSI_F_CHANGE,
|
VIRTIO_SCSI_F_CHANGE,
|
||||||
true),
|
true),
|
||||||
DEFINE_PROP_END_OF_LIST(),
|
DEFINE_PROP_END_OF_LIST(),
|
||||||
|
|
|
@ -35,6 +35,7 @@ typedef struct VHostSCSICommon {
|
||||||
int channel;
|
int channel;
|
||||||
int target;
|
int target;
|
||||||
int lun;
|
int lun;
|
||||||
|
uint64_t host_features;
|
||||||
} VHostSCSICommon;
|
} VHostSCSICommon;
|
||||||
|
|
||||||
int vhost_scsi_common_start(VHostSCSICommon *vsc);
|
int vhost_scsi_common_start(VHostSCSICommon *vsc);
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
typedef struct VHostUserSCSI {
|
typedef struct VHostUserSCSI {
|
||||||
VHostSCSICommon parent_obj;
|
VHostSCSICommon parent_obj;
|
||||||
uint64_t host_features;
|
|
||||||
VhostUserState *vhost_user;
|
VhostUserState *vhost_user;
|
||||||
} VHostUserSCSI;
|
} VHostUserSCSI;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue