From patchwork Thu May 16 15:34:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Hrdina X-Patchwork-Id: 244352 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 1CF2C2C00DE for ; Fri, 17 May 2013 01:34:51 +1000 (EST) Received: from localhost ([::1]:54612 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ud0Cf-0008HS-0H for incoming@patchwork.ozlabs.org; Thu, 16 May 2013 11:34:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ud0CP-0008H0-I3 for qemu-devel@nongnu.org; Thu, 16 May 2013 11:34:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ud0CN-0002b7-TE for qemu-devel@nongnu.org; Thu, 16 May 2013 11:34:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ud0CN-0002aq-Kc for qemu-devel@nongnu.org; Thu, 16 May 2013 11:34:31 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4GFYU8a013535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 16 May 2013 11:34:30 -0400 Received: from antique-laptop.brq.redhat.com (dhcp-27-230.brq.redhat.com [10.34.27.230]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4GFYS0P023826; Thu, 16 May 2013 11:34:29 -0400 From: Pavel Hrdina To: qemu-devel@nongnu.org Date: Thu, 16 May 2013 17:34:28 +0200 Message-Id: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, pbonzini@redhat.com, phrdina@redhat.com Subject: [Qemu-devel] [PATCH] scsi: reset cdrom tray statuses on scsi_disk_reset 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 Tray statuses should be also reseted. Some guests may lock the tray and after reset before any kernel is loaded the tray should be unlocked. Also if you reset the real computer the tray is closed. We should do the same in qemu. This fix is already commited for IDE CD. Check the commit a7f3d65b65b8c86a5ff0c0abcfefb45e2ec6fe4c. Signed-off-by: Pavel Hrdina Reviewed-by: Eric Blake --- hw/scsi/scsi-disk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index c8d2a99..02733dc 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1984,6 +1984,9 @@ static void scsi_disk_reset(DeviceState *dev) nb_sectors--; } s->qdev.max_lba = nb_sectors; + /* reset tray statuses */ + s->tray_locked = 0; + s->tray_open = 0; } static void scsi_destroy(SCSIDevice *dev)