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>
---
hw/scsi/vhost-user-scsi.c | 15 ++++++++-------
include/hw/virtio/vhost-scsi-common.h | 1 +
include/hw/virtio/vhost-user-scsi.h | 1 -
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c
index 9355cfdf07f9..694cb801209a 100644
--- a/hw/scsi/vhost-user-scsi.c
+++ b/hw/scsi/vhost-user-scsi.c
@@ -141,9 +141,10 @@ static uint64_t vhost_user_scsi_get_features(VirtIODevice *vdev,
uint64_t features, Error **errp)
{
VHostUserSCSI *s = VHOST_USER_SCSI(vdev);
+ VHostSCSICommon *vsc = VHOST_SCSI_COMMON(s);
/* 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);
}
@@ -157,12 +158,12 @@ static Property vhost_user_scsi_properties[] = {
DEFINE_PROP_UINT32("max_sectors", VirtIOSCSICommon, conf.max_sectors,
0xFFFF),
DEFINE_PROP_UINT32("cmd_per_lun", VirtIOSCSICommon, conf.cmd_per_lun, 128),
- DEFINE_PROP_BIT64("hotplug", VHostUserSCSI, host_features,
- VIRTIO_SCSI_F_HOTPLUG,
- true),
- DEFINE_PROP_BIT64("param_change", VHostUserSCSI, host_features,
- VIRTIO_SCSI_F_CHANGE,
- true),
+ DEFINE_PROP_BIT64("hotplug", VHostSCSICommon, host_features,
+ VIRTIO_SCSI_F_HOTPLUG,
+ true),
+ DEFINE_PROP_BIT64("param_change", VHostSCSICommon, host_features,
+ VIRTIO_SCSI_F_CHANGE,
+ true),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/include/hw/virtio/vhost-scsi-common.h b/include/hw/virtio/vhost-scsi-common.h
index 4553be4bc378..57fb1d87b51d 100644
--- a/include/hw/virtio/vhost-scsi-common.h
+++ b/include/hw/virtio/vhost-scsi-common.h
@@ -35,6 +35,7 @@ typedef struct VHostSCSICommon {
int channel;
int target;
int lun;
+ uint64_t host_features;
} VHostSCSICommon;
int vhost_scsi_common_start(VHostSCSICommon *vsc);
diff --git a/include/hw/virtio/vhost-user-scsi.h b/include/hw/virtio/vhost-user-scsi.h
index 3ec34ae867ab..e429cacd8e06 100644
--- a/include/hw/virtio/vhost-user-scsi.h
+++ b/include/hw/virtio/vhost-user-scsi.h
@@ -30,7 +30,6 @@
typedef struct VHostUserSCSI {
VHostSCSICommon parent_obj;
- uint64_t host_features;
VhostUserState *vhost_user;
} VHostUserSCSI;
--
2.17.1
> On 8 Aug 2018, at 12:52, Greg Edwards <gedwards@ddn.com> wrote: > > 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> > --- > hw/scsi/vhost-user-scsi.c | 15 ++++++++------- > include/hw/virtio/vhost-scsi-common.h | 1 + > include/hw/virtio/vhost-user-scsi.h | 1 - > 3 files changed, 9 insertions(+), 8 deletions(-) > Reviewed-by: Felipe Franciosi <felipe@nutanix.com>
© 2016 - 2025 Red Hat, Inc.