From patchwork Sun Jul 29 21:52:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ronnie sahlberg X-Patchwork-Id: 173935 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 3DF6A2C007A for ; Mon, 30 Jul 2012 07:52:39 +1000 (EST) Received: from localhost ([::1]:37853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvbPh-0007Gv-Dw for incoming@patchwork.ozlabs.org; Sun, 29 Jul 2012 17:52:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvbPX-00078t-TN for qemu-devel@nongnu.org; Sun, 29 Jul 2012 17:52:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvbPW-0003gp-Rc for qemu-devel@nongnu.org; Sun, 29 Jul 2012 17:52:27 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:34874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvbPW-0003fQ-Lv for qemu-devel@nongnu.org; Sun, 29 Jul 2012 17:52:26 -0400 Received: by mail-pb0-f45.google.com with SMTP id ro12so8308161pbb.4 for ; Sun, 29 Jul 2012 14:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=fRvCHj1Tp063FuTxtUgTasFuWsPx9UETSrcV4opfqMU=; b=EoK60qjRhDkvyXu79g31LAOqhYPG7HG4Z+mrvnujO97L09KfzUy87gfVI9mr4xe8sQ HRcqjqiNbxVPKrFrEx213/Y95K4Fb/5TgqCrTNt2hS1PhyEcWWe+bBMxwDCDlDDibOOM BrUjWvU9mAJJydK5bQH8el7xUj6E8se28PAWdQ5dUwayvUztBzlI2E5TZkdPpb1bdrJN Gi3pclscEPkasXKXQ3LB9KFGAPe7rPhWjWhfQPLpW5qmfqFHKIydzfRSAGXODn+sglcx L3AXHSz+7xHzzOR1Ivw0TCxGctVB6ePHOzxokA0ZU9wJwVb8TYuAxenE7VJb8O0ReM8q 4sWA== Received: by 10.66.88.68 with SMTP id be4mr20294111pab.23.1343598746103; Sun, 29 Jul 2012 14:52:26 -0700 (PDT) Received: from ronniesahlberg@gmail.com (CPE-124-179-22-22.lns5.ken.bigpond.net.au. [124.179.22.22]) by mx.google.com with ESMTPS id pq1sm4646290pbb.3.2012.07.29.14.52.22 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 Jul 2012 14:52:25 -0700 (PDT) Received: by ronniesahlberg@gmail.com (sSMTP sendmail emulation); Mon, 30 Jul 2012 07:52:22 +1000 From: Ronnie Sahlberg To: qemu-devel@nongnu.org, pbonzini@redhat.com Date: Mon, 30 Jul 2012 07:52:03 +1000 Message-Id: <1343598723-12299-2-git-send-email-ronniesahlberg@gmail.com> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1343598723-12299-1-git-send-email-ronniesahlberg@gmail.com> References: <1343598723-12299-1-git-send-email-ronniesahlberg@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: Ronnie Sahlberg Subject: [Qemu-devel] [PATCH] SCSI: Update the sense code for PREVENT REMOVAL errors 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 Change the sense codes for failures to eject a device that is locked by PREVENT_ALLOW_MEDIUM_REMOVAL from the generic MEDIA_LOAD_OR_EJECT_FAILED to the more specific MEDIUM_REMOVAL_PREVENTED. The second sense code is more accurate, and is also listed in MMC annex F for the recommended sense codes for MMC devices while the first sense code is not. Signed-off-by: Ronnie Sahlberg --- hw/scsi-bus.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index dc74063..9929d3c 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -1089,7 +1089,7 @@ const struct SCSISense sense_code_NO_MEDIUM = { /* LUN not ready, medium removal prevented */ const struct SCSISense sense_code_NOT_READY_REMOVAL_PREVENTED = { - .key = NOT_READY, .asc = 0x53, .ascq = 0x00 + .key = NOT_READY, .asc = 0x53, .ascq = 0x02 }; /* Hardware error, internal target failure */ @@ -1129,7 +1129,7 @@ const struct SCSISense sense_code_INCOMPATIBLE_FORMAT = { /* Illegal request, medium removal prevented */ const struct SCSISense sense_code_ILLEGAL_REQ_REMOVAL_PREVENTED = { - .key = ILLEGAL_REQUEST, .asc = 0x53, .ascq = 0x00 + .key = ILLEGAL_REQUEST, .asc = 0x53, .ascq = 0x02 }; /* Command aborted, I/O process terminated */