From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2oR5-0001R2-TS for qemu-devel@nongnu.org; Sat, 18 Aug 2012 15:11:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2oR4-0007o2-PX for qemu-devel@nongnu.org; Sat, 18 Aug 2012 15:11:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2oR4-0007ny-GQ for qemu-devel@nongnu.org; Sat, 18 Aug 2012 15:11:50 -0400 Date: Sat, 18 Aug 2012 22:12:43 +0300 From: "Michael S. Tsirkin" Message-ID: <20120818191243.GB17770@redhat.com> References: <1344846917-7411-1-git-send-email-nab@linux-iscsi.org> <1344846917-7411-4-git-send-email-nab@linux-iscsi.org> <20120813085325.GH14081@redhat.com> <1344976274.22433.93.camel@haakon2.linux-iscsi.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1344976274.22433.93.camel@haakon2.linux-iscsi.org> Subject: Re: [Qemu-devel] [RFC-v2 3/6] vhost-scsi: add -vhost-scsi host device for use with tcm-vhost List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Nicholas A. Bellinger" Cc: Anthony Liguori , Stefan Hajnoczi , kvm-devel , Jan Kiszka , Zhi Yong Wu , qemu-devel , Zhi Yong Wu , Anthony Liguori , target-devel , Hannes Reinecke , Paolo Bonzini , lf-virt , Christoph Hellwig On Tue, Aug 14, 2012 at 01:31:14PM -0700, Nicholas A. Bellinger wrote: > On Mon, 2012-08-13 at 11:53 +0300, Michael S. Tsirkin wrote: > > On Mon, Aug 13, 2012 at 08:35:14AM +0000, Nicholas A. Bellinger wrote: > > > From: Stefan Hajnoczi > > > > > > This patch adds a new type of host device that drives the vhost_scsi > > > device. The syntax to add vhost-scsi is: > > > > > > qemu -vhost-scsi id=vhost-scsi0,wwpn=...,tpgt=123 > > > > > > The virtio-scsi emulated device will make use of vhost-scsi to process > > > virtio-scsi requests inside the kernel and hand them to the in-kernel > > > SCSI target stack using the tcm_vhost fabric driver. > > > > > > +static VHostSCSI *vhost_scsi_add(const char *id, const char *wwpn, > > > + uint16_t tpgt) > > > +{ > > > + VHostSCSI *vs = g_malloc0(sizeof(*vs)); > > > + int ret; > > > + > > > + /* TODO set up vhost-scsi device and bind to tcm_vhost/$wwpm/tpgt_$tpgt */ > > > + fprintf(stderr, "wwpn = \"%s\" tpgt = \"%u\"\n", id, tpgt); > > > + > > > + ret = vhost_dev_init(&vs->dev, -1, "/dev/vhost-scsi", false); > > > > This -1 is a hack. You need to support passing in fd from > > the monitor, and pass it here. > > > > Mmm, looking at how vhost_net_init + tap.c does this, but am not quite > what fd needs to be propagated up for virtio-scsi -> vhost-scsi.. > > Can you please elaborate on this one a bit more..? > > --nab > The idea is to allow running as a user without access to /dev/vhost-scsi. For this, allow passing in the fd of /dev/vhost-scsi through unix domain sockets. -- MST