From patchwork Wed Apr 13 12:05:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 90993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4F948B6F70 for ; Wed, 13 Apr 2011 22:04:45 +1000 (EST) Received: from localhost ([::1]:35403 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9yoM-0005DJ-Mh for incoming@patchwork.ozlabs.org; Wed, 13 Apr 2011 08:04:42 -0400 Received: from eggs.gnu.org ([140.186.70.92]:53170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9ymm-0002rn-Ee for qemu-devel@nongnu.org; Wed, 13 Apr 2011 08:03:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9yme-0003hS-LK for qemu-devel@nongnu.org; Wed, 13 Apr 2011 08:03:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9yme-0003hN-98 for qemu-devel@nongnu.org; Wed, 13 Apr 2011 08:02:56 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3DC2sVP010097 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 13 Apr 2011 08:02:55 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3DC2n9J032484; Wed, 13 Apr 2011 08:02:54 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Wed, 13 Apr 2011 14:05:09 +0200 Message-Id: <1302696316-26190-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1302696316-26190-1-git-send-email-kwolf@redhat.com> References: <1302696316-26190-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 03/10] atapi: Drives can be locked without media present 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: Amit Shah Drivers are free to lock drives without any media present. Such a condition should not result in an error condition. See Table 341 in MMC-5 spec for details. Signed-off-by: Amit Shah Signed-off-by: Kevin Wolf --- hw/ide/core.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index c11d457..a290142 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -1230,13 +1230,8 @@ static void ide_atapi_cmd(IDEState *s) ide_atapi_cmd_reply(s, 18, max_len); break; case GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL: - if (bdrv_is_inserted(s->bs)) { - bdrv_set_locked(s->bs, packet[4] & 1); - ide_atapi_cmd_ok(s); - } else { - ide_atapi_cmd_error(s, SENSE_NOT_READY, - ASC_MEDIUM_NOT_PRESENT); - } + bdrv_set_locked(s->bs, packet[4] & 1); + ide_atapi_cmd_ok(s); break; case GPCMD_READ_10: case GPCMD_READ_12: