From patchwork Tue Mar 5 17:05:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 225089 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 513B12C03D0 for ; Wed, 6 Mar 2013 04:06:22 +1100 (EST) Received: from localhost ([::1]:33473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCvJk-0005j9-FU for incoming@patchwork.ozlabs.org; Tue, 05 Mar 2013 12:06:20 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCvJD-0005eE-Kf for qemu-devel@nongnu.org; Tue, 05 Mar 2013 12:05:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCvJ9-0008Sb-96 for qemu-devel@nongnu.org; Tue, 05 Mar 2013 12:05:47 -0500 Received: from mail-qe0-f44.google.com ([209.85.128.44]:44703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCvJ9-0008SU-36; Tue, 05 Mar 2013 12:05:43 -0500 Received: by mail-qe0-f44.google.com with SMTP id x7so4852291qeu.31 for ; Tue, 05 Mar 2013 09:05:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=Tu1CpeZkMXbJq897WqkZdXXc7hd3auvLqFtdVybyqKI=; b=ARh9r713Uv9i/zMEGhNlN/XH1Zoym/W7+vlPa/NoxJA8wxde1Ypu+zZqrL6umIyh4L A15pfGYvhscM7TW42SjzHPXzU6fYJc3vCprJknOQfPks080blEgiFn8tAFVreo/bRVMw bFh8gMFoGgIyetZNVIgaq5Ouu5j3v1wlV7gWrkSQM4395rjKlpLjJBTLLkNY8WUAKuMn DbAKQGR3qErFOzWOsnLIufra3ORxAx5F0aCwtvppFiRCNtnM0jYxpXin5LqWGAdGB+kb 7ugsek9+J923ZP1eRcezFsAcmQ5sJ8aTkdWSge454VcqLHXyCmyhL60nz4KZ3iipMEze RvWg== X-Received: by 10.224.193.200 with SMTP id dv8mr32932827qab.85.1362503142754; Tue, 05 Mar 2013 09:05:42 -0800 (PST) Received: from yakj.usersys.redhat.com (93-34-176-20.ip50.fastwebnet.it. [93.34.176.20]) by mx.google.com with ESMTPS id z9sm43633830qae.5.2013.03.05.09.05.41 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 05 Mar 2013 09:05:42 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 5 Mar 2013 18:05:23 +0100 Message-Id: <1362503125-27057-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1362503125-27057-1-git-send-email-pbonzini@redhat.com> References: <1362503125-27057-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.128.44 Cc: qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH 4/6] scsi: do not call scsi_read_data/scsi_write_data for a canceled request X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c | 4 ++++ trace-events | 1 + 2 files changed, 5 insertions(+) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index a97f1cd..01e1dec 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -1508,6 +1508,10 @@ void scsi_req_unref(SCSIRequest *req) will start the next chunk or complete the command. */ void scsi_req_continue(SCSIRequest *req) { + if (req->io_canceled) { + trace_scsi_req_continue_canceled(req->dev->id, req->lun, req->tag); + return; + } trace_scsi_req_continue(req->dev->id, req->lun, req->tag); if (req->cmd.mode == SCSI_XFER_TO_DEV) { req->ops->write_data(req); diff --git a/trace-events b/trace-events index a27ae43..3064fc7 100644 --- a/trace-events +++ b/trace-events @@ -460,6 +460,7 @@ scsi_req_data(int target, int lun, int tag, int len) "target %d lun %d tag %d le scsi_req_data_canceled(int target, int lun, int tag, int len) "target %d lun %d tag %d len %d" scsi_req_dequeue(int target, int lun, int tag) "target %d lun %d tag %d" scsi_req_continue(int target, int lun, int tag) "target %d lun %d tag %d" +scsi_req_continue_canceled(int target, int lun, int tag) "target %d lun %d tag %d" scsi_req_parsed(int target, int lun, int tag, int cmd, int mode, int xfer) "target %d lun %d tag %d command %d dir %d length %d" scsi_req_parsed_lba(int target, int lun, int tag, int cmd, uint64_t lba) "target %d lun %d tag %d command %d lba %"PRIu64 scsi_req_parse_bad(int target, int lun, int tag, int cmd) "target %d lun %d tag %d command %d"