From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34016 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLBKW-0004vv-Fg for qemu-devel@nongnu.org; Wed, 24 Nov 2010 04:07:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PLBKV-0003rp-42 for qemu-devel@nongnu.org; Wed, 24 Nov 2010 04:07:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PLBKU-0003rT-Rq for qemu-devel@nongnu.org; Wed, 24 Nov 2010 04:07:55 -0500 Message-ID: <4CECD5E3.6010007@redhat.com> Date: Wed, 24 Nov 2010 10:07:47 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1290588035-8950-1-git-send-email-nab@linux-iscsi.org> In-Reply-To: <1290588035-8950-1-git-send-email-nab@linux-iscsi.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 5/5] scsi-bsg: Add initial support for BSG based SCSIDeviceInfo List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Nicholas A. Bellinger" Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel , Hannes Reinecke , Gerd Hoffmann On 11/24/2010 09:40 AM, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > This patch adds initial support for using the Linux BSG interface with write/read vectored > AIO as a QEMU backstore (SCSIDeviceInfo) with hw/scsi-bus.c compatible HBA emulation. > > So far it has been tested with x86_64 host and guest using hw/megasas.c and TCM_Loop LLD > Port LUNs. Because this patch uses struct iovec for struct sg_io_v4->d[out,in]_xferp payloads, > which currently requires a patch to linux/block/bsg.c:bsg_map_hdr() in order to setup the > user -> kernel iovecs. This patch can be found in lio-core-2.6.git here: > > commit fec4e8457c744de50e1ead69a36d5c4ee089d1ac > Author: Nicholas Bellinger > Date: Sun Jun 13 23:13:20 2010 -0700 > > [BSG]: Add support for struct sg_io_v4->d[out,in]_iovec_count > > This also will only currently work with paired user/kernel (eg: 64bit user / 64bit kernel) > because of different pointer sizes in struct iovec->iov_base. > > There are also two FIXMEs in hw/scsi-bsg.c:bsg_generic_initfn() related to extraction of > SCSI LUN and device type values using BSG and required by QEMU-KVM. Any reason why this should be a different driver than scsi-generic, i.e. why the scsi-generic should not switch automatically between SG and BSG depending on the kind of device being opened? In fact, there is no reason why scsi-generic should use bounce buffers rather than sg_iovec_t, so that most of the differences between scsi-generic and scsi-bsg would go away. Paolo