From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NlYE3-0007bc-Cs for qemu-devel@nongnu.org; Sat, 27 Feb 2010 20:45:43 -0500 Received: from [199.232.76.173] (port=35450 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NlYE2-0007bU-2N for qemu-devel@nongnu.org; Sat, 27 Feb 2010 20:45:42 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NlYE1-00082l-EF for qemu-devel@nongnu.org; Sat, 27 Feb 2010 20:45:41 -0500 Received: from mx20.gnu.org ([199.232.41.8]:56803) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NlYE1-00082g-7w for qemu-devel@nongnu.org; Sat, 27 Feb 2010 20:45:41 -0500 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NlYE0-0004i2-GS for qemu-devel@nongnu.org; Sat, 27 Feb 2010 20:45:40 -0500 From: Paul Brook Subject: Re: [Qemu-devel] Re: [PATCH] scsi: Make device scsi-disk reject /dev/sg* Date: Sun, 28 Feb 2010 01:45:37 +0000 References: <4B865CA8.4010505@redhat.com> In-Reply-To: <4B865CA8.4010505@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201002280145.38065.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Markus Armbruster > On 02/25/10 11:23, Markus Armbruster wrote: > > You're supposed to use scsi-generic for that. Which rejects anything > > but /dev/sg*. > > Well, it isn't *that* easy. The SG_IO ioctl used by scsi-generic works > on tons of devices in linux, not only /dev/sg*. I've seen patches > floading around which change the check bdrv_is_sg() into "try SG_IO and > see if it works", which would allow to use /dev/sda with both scsi-disk > and scsi-generic depending on what you want. Which makes alot of sense. > > Making that change needs some extra care though to avoid existing > configurations switching from scsi-disk to scsi-generic unnoticed. Don't we really want to be testing !bdrv_is_block() ? Paul