From patchwork Tue Jun 18 14:16:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 252365 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EDE8D2C02B9 for ; Wed, 19 Jun 2013 00:47:44 +1000 (EST) Received: from localhost ([::1]:36458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UownD-00077q-1X for incoming@patchwork.ozlabs.org; Tue, 18 Jun 2013 10:21:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UowiZ-0008QC-HN for qemu-devel@nongnu.org; Tue, 18 Jun 2013 10:17:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UowiY-0001NR-6X for qemu-devel@nongnu.org; Tue, 18 Jun 2013 10:17:07 -0400 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:44772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UowiY-0001NF-0Q; Tue, 18 Jun 2013 10:17:06 -0400 Received: by mail-wi0-f177.google.com with SMTP id ey16so3280805wid.4 for ; Tue, 18 Jun 2013 07:17:05 -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=+3U8fR48uPSWyJTyKdN+iIgrNfN2UoIPXarpUedcmT4=; b=nZ4qVd5v56p8zKKgJC8r+nZZeaazfqJqrhkqe9085a71NphgKWrQ57jGhBc+a4nOcZ yPM35rr77p05Q5BXnnACrVtSL9SS6HuP0do/9e9G6YYSXROVbKmWROsAQhBHmjcS/Myj JYGY3w1D0cu+z/1avwgt80USbLa0MgKD8uBqwwS7e0gEZ8q6+23XnWM2pwWV8+5vvAss HiHSyIpsYzlWM/Z/mD1x3PdZcVsf8QooPvhrXOWGW10VHXiRlCB4scmNZrhLLyr3w8Rt vCcQW5cijxQjOegToFfICfLiHvF3vTpoWMulJCr+0rpu9C/RSEd0mZHHR00AFGFDJv2n ppGg== X-Received: by 10.180.107.163 with SMTP id hd3mr6825819wib.13.1371565025262; Tue, 18 Jun 2013 07:17:05 -0700 (PDT) Received: from playground.lan (net-37-116-217-184.cust.dsl.vodafone.it. [37.116.217.184]) by mx.google.com with ESMTPSA id o14sm2385861wiv.3.2013.06.18.07.17.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 18 Jun 2013 07:17:03 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 18 Jun 2013 16:16:50 +0200 Message-Id: <1371565016-2643-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1371565016-2643-1-git-send-email-pbonzini@redhat.com> References: <1371565016-2643-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::231 Cc: Pavel Hrdina , mdroth@linux.vnet.ibm.com, qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH 1/7] 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 From: Pavel Hrdina Tray statuses should be also reset. Some guests may lock the tray and right after resetting the guest it should be unlocked and closed. This is done on power-on, reset and resume from suspend/hibernate on bare-metal. This fix is already committed for IDE CD. Check the commit a7f3d65b65b8c86a5ff0c0abcfefb45e2ec6fe4c. Test results on bare-metal: - on reset/power-on the CD-ROM tray is closed even before the monitor is turned on - on resume from suspend/hibernate the tray is also closed before the monitor is turned on From test results it seems that this behavior is OS and probably BIOS independent. Cc: qemu-stable@nongnu.org Signed-off-by: Pavel Hrdina Signed-off-by: Paolo Bonzini --- 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)