vhost-user-scsi: move host_features into VHostSCSICommon
authorGreg Edwards <gedwards@ddn.com>
Wed, 8 Aug 2018 19:52:33 +0000 (13:52 -0600)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Aug 2018 16:46:25 +0000 (18:46 +0200)
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>
hw/scsi/vhost-user-scsi.c
include/hw/virtio/vhost-scsi-common.h
include/hw/virtio/vhost-user-scsi.h

index 9355cfdf07f94a23089dd47b6ba1684f102b4775..694cb801209a017e0d1984e3e893c59ae5ce6e4c 100644 (file)
@@ -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(),
 };
 
index 4553be4bc378867b99a5ff1c6ee33df2c548e8aa..57fb1d87b51db89ed8b6112d5ec8f2f20df597af 100644 (file)
@@ -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);
index 3ec34ae867ab2e69010042caa13b71c60d254580..e429cacd8e0631778ee8e061ba6bb3dfa63e7a5b 100644 (file)
@@ -30,7 +30,6 @@
 
 typedef struct VHostUserSCSI {
     VHostSCSICommon parent_obj;
-    uint64_t host_features;
     VhostUserState *vhost_user;
 } VHostUserSCSI;
 
This page took 0.028918 seconds and 4 git commands to generate.