From 5278beb83c98fdda2a31a97db0633393d0b5322e Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 4 Oct 2011 16:23:53 +0200 Subject: [PATCH 18/76] atapi: Drives can be locked without media present RH-Author: Markus Armbruster Message-id: <1317745491-18401-11-git-send-email-armbru@redhat.com> Patchwork-id: 33612 O-Subject: [PATCH RHEL-6.2 qemu-kvm 10/68] atapi: Drives can be locked without media present Bugzilla: 742469 RH-Acked-by: Paolo Bonzini RH-Acked-by: Amit Shah RH-Acked-by: Juan Quintela 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 (cherry picked from commit 8aa71917f7be78151cff50b850a25f26de614b13) Signed-off-by: Markus Armbruster --- hw/ide/core.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) Signed-off-by: Michal Novotny --- 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 0075d5e..a68dad7 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -1557,13 +1557,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: -- 1.7.4.4