OSDN Git Service

megasas: clean up and fix request completion/cancellation
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 10 Nov 2016 15:27:51 +0000 (16:27 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 28 Nov 2016 14:11:17 +0000 (15:11 +0100)
commit9e55d58806feedca9341a63243304fbbeaac741d
tree2dc05966e5fa457f00bf2db5567c0e910ff1cc3c
parent75f19f8c3006970632303b49043b075dc4fe922e
megasas: clean up and fix request completion/cancellation

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 <pbonzini@redhat.com>
Message-Id: <20161110152751.4267-2-pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/megasas.c