From patchwork Fri Aug 3 08:06:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 174950 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 7B9C72C00A2 for ; Fri, 3 Aug 2012 18:46:52 +1000 (EST) Received: from localhost ([::1]:59232 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxCum-0001Nd-1N for incoming@patchwork.ozlabs.org; Fri, 03 Aug 2012 04:07:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxCu9-0000Jf-0t for qemu-devel@nongnu.org; Fri, 03 Aug 2012 04:06:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SxCu1-0006jr-Kv for qemu-devel@nongnu.org; Fri, 03 Aug 2012 04:06:40 -0400 Received: from mail-yx0-f173.google.com ([209.85.213.173]:43803) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxCu1-0006jn-HA for qemu-devel@nongnu.org; Fri, 03 Aug 2012 04:06:33 -0400 Received: by yenl1 with SMTP id l1so500907yen.4 for ; Fri, 03 Aug 2012 01:06:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=nzVhadrpvFIFgTkrmeAETtbwvVRfEXRSMJlfmvjWfU8=; b=fM82eSBEtoY8cliqUeVWG4kniCUHTWwccS1dTqn98aa+QRLSjB94qRXKmuzwa8aeSx ST5fMGK3QQevaw9AxuvJgBe6EfgIs7hQo39PIuqoZwjFmUDYBVejqCpC1oT/pyHqJYOr 44S+m2U7gjvvycFbKKnHITP/ITTXjwnAIGG+PeEU2MXN2C96K27Xr2v8xtSOOGTgdtae yESNEICW/gFdXE5d76CpPQ+M8MJbi7Oqzb/PHVcxCoZskngED1SbbGCyuoGFdFj7f9oo rb/YyzJgNFr18RM4ZmS0NCMAtqtjl8SFUOqHggM8gwRg4wFeuwY/Gwhpn0zzv9g7xteQ qyIg== Received: by 10.50.88.134 with SMTP id bg6mr9328226igb.0.1343981192742; Fri, 03 Aug 2012 01:06:32 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-169-1.ip50.fastwebnet.it. [93.34.169.1]) by mx.google.com with ESMTPS id rd8sm19683913igb.3.2012.08.03.01.06.30 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 03 Aug 2012 01:06:31 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 3 Aug 2012 10:06:11 +0200 Message-Id: <1343981180-23817-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1343981180-23817-1-git-send-email-pbonzini@redhat.com> References: <1343981180-23817-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.213.173 Cc: Ronnie Sahlberg Subject: [Qemu-devel] [PATCH 01/10] 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 From: Ronnie Sahlberg 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 Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index e4ec19e..68049f6 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -1103,7 +1103,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 */ @@ -1153,7 +1153,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 */