From: "Nicholas A. Bellinger" Subject: Re: [PATCH] kvm tools: Add initial virtio-scsi support Date: Tue, 14 Aug 2012 17:06:11 -0700 Message-ID: <1344989171.22433.164.camel@haakon2.linux-iscsi.org> References: <1344473464-17267-1-git-send-email-asias.hejun@gmail.com> <20120814064522.GA8702@stefanha-thinkpad.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Asias He , Pekka Enberg , Sasha Levin , Ingo Molnar , Cyrill Gorcunov , kvm@vger.kernel.org, Paolo Bonzini To: Stefan Hajnoczi Return-path: Received: from mail.linux-iscsi.org ([67.23.28.174]:55732 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753982Ab2HOAGO (ORCPT ); Tue, 14 Aug 2012 20:06:14 -0400 In-Reply-To: <20120814064522.GA8702@stefanha-thinkpad.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 2012-08-14 at 07:45 +0100, Stefan Hajnoczi wrote: > On Tue, Aug 14, 2012 at 09:52:55AM +0800, Asias He wrote: > > On Mon, Aug 13, 2012 at 3:24 PM, Pekka Enberg wrote: > > > On Thu, Aug 9, 2012 at 3:51 AM, Asias He wrote: > > >> --- > > >> diff --git a/tools/kvm/include/kvm/disk-image.h b/tools/kvm/include/kvm/disk-image.h > > >> index 7ae17f8..54e4047 100644 > > >> --- a/tools/kvm/include/kvm/disk-image.h > > >> +++ b/tools/kvm/include/kvm/disk-image.h > > >> @@ -41,6 +41,8 @@ struct disk_image_operations { > > >> > > >> struct disk_image_params { > > >> const char *filename; > > >> + const char *wwpn; > > >> + const char *tpgt; > > > > > > Maybe it's just me but "wwpn" and "tpgt" really could use a comment > > > explaining what they are... > > > > OK. They are terminology from linux target. > > > > wwpn == world wide port number > > tpgt == target port group tag > > Target Portal Group Tag > > TPGT is iSCSI-specific terminology but other transports like SAS or FCP > have similar concepts of naming target ports. I think this terminology > is used by the LIO target regardless of the fabric. > > The SCSI Architecture Model standard says the target port name is the > "name (see 3.1.70) of a SCSI target port that is world wide unique > within the SCSI transport protocol of the SCSI domain of that SCSI > target port". > The idea of a TargetPortalGroupTag originally came from iSCSI to do logical partitioning of a single TargetName (IQN or EUI) instance with different LUN/auth/network portal configurations. For iSCSI fabrics, the SCSI target WWPN takes the form of a symbolic string as: $TARGETNAME+t+0x$TPGT In generic target_core_fabric_configfs.c code, all SCSI target endpoints are attached to se_portal_group->tpg_group residing individually at /sys/kernel/config/target/$FABRIC/$FABRIC_WWN/$TPGT/. It's parent configfs group is at se_wwn->wwn_group, who's higher level parent is the top level fabric group registered by the fabric driver with TCM. So the $FABRIC_WWN/$TPGT/[luns,acls] groups hang off this primary config_group, which means that currently non iSCSI target based fabric drivers are required to individually enforce TPGT=1 usage in their own code when mapping SCSI target WWPNs to underlying storage HW WWPNs, or a fabric using software based WWPNs (as iSCSI does). Also, from the user level of rtsadmin/targetcli we do hide the notion of TPGTs for all non iscsi fabrics, however using rtslib directly does still require following the underlying $FABRIC/$FABRIC_WWN/$TPGT/ object layout. --nab