Am 27.06.2013 um 15:11 hat Peter Lieven geschrieben: > Signed-off-by: Peter Lieven <p...@kamp.de> > --- > block/iscsi.c | 80 > ++++++++++++++++++++++++++++++++++++++++----------------- > 1 file changed, 56 insertions(+), 24 deletions(-)
> @@ -1175,6 +1187,26 @@ static int iscsi_open(BlockDriverState *bs, QDict > *options, int flags) > iscsilun->lbpu = inq_lbp->lbpu; > iscsilun->lbpws = inq_lbp->lbpws; > iscsilun->lbpws10 = inq_lbp->lbpws10; > + scsi_free_scsi_task(task); > + task = NULL; > + } > + > + if (iscsilun->lbpu) { > + struct scsi_inquiry_block_limits *inq_bl; > + task = iscsi_do_inquiry(iscsilun->iscsi, iscsilun->lun, 1, > + SCSI_INQUIRY_PAGECODE_BLOCK_LIMITS); > + if (task == NULL) { > + ret = -EINVAL; > + goto out; > + } > + inq_bl = scsi_datain_unmarshall(task); > + if (inq_bl == NULL) { > + error_report("iSCSI: failed to unmarshall inquiry datain blob"); > + ret = -EINVAL; > + goto out; > + } > + iscsilun->max_unmap = inq_bl->max_unmap; > + iscsilun->max_unmap_bdc = inq_bl->max_unmap_bdc; > } How about scsi_free_scsi_task() here as well? It's caught at the end of the function, but I think it's nicer to free it in the block that uses it locally. Kevin