Patchwork [7/8] virtio-scsi: fill in table of feature sizes

login
register
mail settings
Submitter Jesse Larrew
Date Feb. 19, 2013, 11:04 p.m.
Message ID <1361315093-19383-8-git-send-email-jlarrew@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/221929/
State New
Headers show

Comments

Jesse Larrew - Feb. 19, 2013, 11:04 p.m.
Since none of the existing feature bits changed the layout of struct
VirtIOSCSIConf, set the minimum struct size to use the full struct (i.e
endof(struct VirtIOSCSIConf, cmd_per_lun)).

Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
---
 hw/virtio-scsi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
index 6c92975..4a0be44 100644
--- a/hw/virtio-scsi.c
+++ b/hw/virtio-scsi.c
@@ -18,8 +18,12 @@ 
 #include <hw/scsi-defs.h>
 
 static VirtIOFeature feature_sizes[] = {
-    {.flags = 0xffffffff,
-     .end = sizeof(struct VirtIOSCSIConf)},
+    {.flags = 1 << VIRTIO_SCSI_F_INOUT,
+     .end = endof(struct VirtIOSCSIConf, cmd_per_lun)},
+    {.flags = 1 << VIRTIO_SCSI_F_HOTPLUG,
+     .end = endof(struct VirtIOSCSIConf, cmd_per_lun)},
+    {.flags = 1 << VIRTIO_SCSI_F_CHANGE,
+     .end = endof(struct VirtIOSCSIConf, cmd_per_lun)},
     {}
 };