From patchwork Thu Mar 11 14:44:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naphtali Sprei X-Patchwork-Id: 47336 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3A830B7CB9 for ; Fri, 12 Mar 2010 02:10:10 +1100 (EST) Received: from localhost ([127.0.0.1]:50662 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Npk0s-0008AW-1s for incoming@patchwork.ozlabs.org; Thu, 11 Mar 2010 10:09:26 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Npjcw-0004mw-9J for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:44:42 -0500 Received: from [199.232.76.173] (port=55454 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Npjcv-0004m9-Mg for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:44:41 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Npjcu-0007IH-Jk for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:44:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8407) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Npjcu-0007I9-5i for qemu-devel@nongnu.org; Thu, 11 Mar 2010 09:44:40 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2BEicL4026549 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 11 Mar 2010 09:44:38 -0500 Received: from localhost.localdomain (dhcp-0-60.tlv.redhat.com [10.35.0.60]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2BEiZSP005186 for ; Thu, 11 Mar 2010 09:44:37 -0500 From: Naphtali Sprei To: qemu-devel@nongnu.org Date: Thu, 11 Mar 2010 16:44:34 +0200 Message-Id: <1268318674-10607-2-git-send-email-nsprei@redhat.com> In-Reply-To: <1268318674-10607-1-git-send-email-nsprei@redhat.com> References: <1268318674-10607-1-git-send-email-nsprei@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 2/2] read-only: Another minor cleanup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Don't rely on CDROM hint for read_only attribute Signed-off-by: Naphtali Sprei --- hw/scsi-disk.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 8f7ffc1..5cd6ae6 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -612,8 +612,7 @@ static int scsi_disk_emulate_mode_sense(SCSIRequest *req, uint8_t *outbuf) p[1] = 0; /* Default media type. */ p[3] = 0; /* Block descriptor length. */ - if (bdrv_get_type_hint(s->bs) == BDRV_TYPE_CDROM || - bdrv_is_read_only(s->bs)) { + if (bdrv_is_read_only(s->bs)) { p[2] = 0x80; /* Readonly. */ } p += 4;