Skip to contentSkip to conversation

scsi-block: Add share-rw option

PATCH Applied Fam Zheng 2 participants 2 messages Dec 5, 2017

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 scsi-block: Add share-rw option

Scsi-block doesn't use the DEFINE_BLOCK_PROPERTIES() macro so it didn't gain the share-rw back when it was added to all other storage devices. This option is meaningful here, and need to be used when attaching a shared storage to guest.

---
 hw/scsi/scsi-disk.c | 1 +
 1 file changed, 1 insertion(+)
hw/scsi/scsi-disk.c +1 -0
index 12431177a7..ac65830666 100644
@@ -3009,6 +3009,7 @@ static const TypeInfo scsi_cd_info = {
 static Property scsi_block_properties[] = {
     DEFINE_BLOCK_ERROR_PROPERTIES(SCSIDiskState, qdev.conf),         \
     DEFINE_PROP_DRIVE("drive", SCSIDiskState, qdev.conf.blk),
+    DEFINE_PROP_BOOL("share-rw", SCSIDiskState, qdev.conf.share_rw, false),
     DEFINE_PROP_UINT16("rotation_rate", SCSIDiskState, rotation_rate, 0),
     DEFINE_PROP_END_OF_LIST(),
 };
Signature · 1 line
2.14.3
#1 lore raw
Quoted 16 lines · Fam Zheng

Scsi-block doesn't use the DEFINE_BLOCK_PROPERTIES() macro so it didn't gain the share-rw back when it was added to all other storage devices. This option is meaningful here, and need to be used when attaching a shared storage to guest.

---
 hw/scsi/scsi-disk.c | 1 +
 1 file changed, 1 insertion(+)
hw/scsi/scsi-disk.c +0 -0
index 12431177a7..ac65830666 100644

hw/scsi/scsi-disk.c static const TypeInfo scsi_cd_info = { · line 3015

Quoted 7 lines
hw/scsi/scsi-disk.c +1 -0
@@ -3009,6 +3009,7 @@ static const TypeInfo scsi_cd_info = {
 static Property scsi_block_properties[] = {
     DEFINE_BLOCK_ERROR_PROPERTIES(SCSIDiskState, qdev.conf),         \
     DEFINE_PROP_DRIVE("drive", SCSIDiskState, qdev.conf.blk),
+    DEFINE_PROP_BOOL("share-rw", SCSIDiskState, qdev.conf.share_rw, false),
     DEFINE_PROP_UINT16("rotation_rate", SCSIDiskState, rotation_rate, 0),
     DEFINE_PROP_END_OF_LIST(),
 };

Queued, thanks.

Paolo