From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPF3k-0000AA-IX for qemu-devel@nongnu.org; Wed, 25 May 2011 10:27:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QPF3j-00075u-OM for qemu-devel@nongnu.org; Wed, 25 May 2011 10:27:40 -0400 Received: from verein.lst.de ([213.95.11.211]:58657 helo=newverein.lst.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QPF3j-00075U-Ji for qemu-devel@nongnu.org; Wed, 25 May 2011 10:27:39 -0400 Date: Wed, 25 May 2011 15:10:49 +0200 From: Christoph Hellwig Message-ID: <20110525131049.GB2283@lst.de> References: <1305903817-25476-1-git-send-email-pbonzini@redhat.com> <1305903817-25476-4-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1305903817-25476-4-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH 3/6] scsi-generic: allow customization of the lun List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Fri, May 20, 2011 at 05:03:34PM +0200, Paolo Bonzini wrote: > This allows passthrough of devices with LUN != 0, by redirecting them to > LUN0 in the emulated target. I'm not quite sure what this code is for. Each /dev/sg device reresents a LUN. So if we want to suport multiple LUNs in qemu for devices that are backed by scsi-generic devices we need to take REPORT_LUNs emulation into the core scsi code, as any qemu target is completely independent of the underlying scsi device topology. In fact we could easily mix generic and scsi-disk LUNs on a single target. > + case INQUIRY: > + if (req->lun != s->lun) { This seems odd. I'd expect the SCSI core to handle the LUN addressing. For now that is just rejecting wrongs ones, and if multiple LUN support is added dispatching it to the correct drivers instance.