scsi-hd: fix property unset case
PATCH 1/1 scsi-hd: fix property unset case
commit "BlockConf: Call backend functions to detect geometry and blocksizes" causes a segmentation fault on the invalid configuration of a scsi device without a drive.
Lets check for conf.blk before calling blkconf_blocksizes. The error will be handled later on in scsi_realize anyway.
--- hw/scsi/scsi-disk.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
hw/scsi/scsi-disk.c +6 -1
@@ -2291,7 +2291,12 @@ static void scsi_realize(SCSIDevice *dev, Error **errp)static void scsi_hd_realize (SCSIDevice *dev,Error **errp) {SCSIDiskState *s =DO_UPCAST (SCSIDiskState, qdev, dev); -blkconf_blocksizes (&s->qdev.conf); +/* can happen for devices without drive. The error message for missing +* backend will be issued in scsi_realize +*/ +if (s->qdev.conf.blk) { +blkconf_blocksizes (&s->qdev.conf); + } s->qdev.blocksize = s->qdev.conf.logical_block_size; s->qdev.type =TYPE_DISK ;if (!s->product) {
Signature · 1 line
2.1.4
Am 04.03.2015 um 11:02 hat Ekaterina Tumanova geschrieben:
Quoted 11 lines
commit "BlockConf: Call backend functions to detect geometry and blocksizes" causes a segmentation fault on the invalid configuration of a scsi device without a drive.
Lets check for conf.blk before calling
blkconf_blocksizes. The error will be handled later on inscsi_realizeanyway.Reported-by Max Reitz <[email protected]>Reviewed-by Stefan Hajnoczi <[email protected]>Reviewed-by Max Reitz <[email protected]>Signed-off-by Ekaterina Tumanova <[email protected]>
Thanks, added the commit ID of the regression to the commit message, and applied to the block branch.
Kevin
Quoted 8 lines · Kevin Wolf
Am 04.03.2015 um 11:02 hat Ekaterina Tumanova geschrieben:
Quoted 7 lines
commit "BlockConf: Call backend functions to detect geometry and blocksizes" causes a segmentation fault on the invalid configuration of a scsi device without a drive.
Lets check for conf.blk before calling
blkconf_blocksizes. The error will be handled later on inscsi_realizeanyway.
Quoted 6 lines
Quoted 4 lines
Reported-by Max Reitz <[email protected]>Reviewed-by Stefan Hajnoczi <[email protected]>Reviewed-by Max Reitz <[email protected]>Signed-off-by Ekaterina Tumanova <[email protected]>Thanks, added the commit ID of the regression to the commit message, and applied to the block branch.
But that commit is not yet upstream, so the ID won't be stable. Are you planning to change it once it's merged?
Max
Am 04.03.2015 um 14:58 hat Max Reitz geschrieben:
Quoted 13 lines · Kevin Wolf
Quoted 12 lines
Am 04.03.2015 um 11:02 hat Ekaterina Tumanova geschrieben:
Quoted 11 lines
commit "BlockConf: Call backend functions to detect geometry and blocksizes" causes a segmentation fault on the invalid configuration of a scsi device without a drive.
Lets check for conf.blk before calling
blkconf_blocksizes. The error will be handled later on inscsi_realizeanyway.Reported-by Max Reitz <[email protected]>Reviewed-by Stefan Hajnoczi <[email protected]>Reviewed-by Max Reitz <[email protected]>Signed-off-by Ekaterina Tumanova <[email protected]>
Quoted 5 lines
Quoted 2 lines
Thanks, added the commit ID of the regression to the commit message, and applied to the block branch.
But that commit is not yet upstream, so the ID won't be stable. Are you planning to change it once it's merged?
Unless someone touches the pull request (which he shouldn't), the commit ID is going to stay.
Kevin
Quoted 14 lines · Kevin Wolf
Am 04.03.2015 um 14:58 hat Max Reitz geschrieben:
Quoted 13 lines · Kevin Wolf
Quoted 12 lines
Am 04.03.2015 um 11:02 hat Ekaterina Tumanova geschrieben:
Quoted 11 lines
commit "BlockConf: Call backend functions to detect geometry and blocksizes" causes a segmentation fault on the invalid configuration of a scsi device without a drive.
Lets check for conf.blk before calling
blkconf_blocksizes. The error will be handled later on inscsi_realizeanyway.Reported-by Max Reitz <[email protected]>Reviewed-by Stefan Hajnoczi <[email protected]>Reviewed-by Max Reitz <[email protected]>Signed-off-by Ekaterina Tumanova <[email protected]>
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Thanks, added the commit ID of the regression to the commit message, and applied to the block branch.
But that commit is not yet upstream, so the ID won't be stable. Are you planning to change it once it's merged?
Unless someone touches the pull request (which he shouldn't), the commit ID is going to stay.
Oh, that's nice, I didn't know that. Thanks for explaining.
Max