qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.8] megasas: clean up and fix request compl


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH for-2.8] megasas: clean up and fix request completion/cancellation
Date: Fri, 11 Nov 2016 14:11:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0


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 <address@hidden>
>> ---
>>  hw/scsi/megasas.c | 53 ++++++++++++++++++++++++++++-------------------------
>>  1 file changed, 28 insertions(+), 25 deletions(-)
> 
> Reviewed-by: Stefan Hajnoczi <address@hidden>
> 
>> @@ -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

[Prev in Thread] Current Thread [Next in Thread]