On 11/11/2016 13:50, Stefan Hajnoczi wrote:
> On Thu, Nov 10, 2016 at 04:27:51PM +0100, Paolo Bonzini wrote:
>> megasas_command_cancel is a callback; it should report the abort in
>> the frame, not try another abort!  Compare for instance with
>> mptsas_request_cancelled.
>>
>> So extract the common bits for request completion in a new function
>> megasas_complete_command, call it from both the .complete and .cancel
>> callbacks, and remove duplicate pieces from the DCMD path.
>>
>> Signed-off-by: Paolo Bonzini <[email protected]>
>> ---
>>  hw/scsi/megasas.c | 53 ++++++++++++++++++++++++++++-------------------------
>>  1 file changed, 28 insertions(+), 25 deletions(-)
> 
> Reviewed-by: Stefan Hajnoczi <[email protected]>
> 
>> @@ -2316,7 +2319,7 @@ static const struct SCSIBusInfo megasas_scsi_info = {
>>      .transfer_data = megasas_xfer_complete,
>>      .get_sg_list = megasas_get_sg_list,
>>      .complete = megasas_command_complete,
>> -    .cancel = megasas_command_cancel,
>> +    .cancel = megasas_command_cancelled,
> 
> Should .cancel be renamed in a separate patch?

Good idea, or even .request_completed/.request_cancelled.

Paolo

Reply via email to