From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH 4/4] libxl: add support for vscsi Date: Mon, 2 Mar 2015 16:11:27 +0100 Message-ID: <20150302151127.GA20719@aepfle.de> References: <1425291362-30228-1-git-send-email-olaf@aepfle.de> <1425291362-30228-5-git-send-email-olaf@aepfle.de> <20150302142040.GA17851@aepfle.de> <1425306666.21151.58.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1425306666.21151.58.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Wei Liu , Stefano Stabellini , Ian Jackson , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, Mar 02, Ian Campbell wrote: > On Mon, 2015-03-02 at 15:20 +0100, Olaf Hering wrote: > > Its used as //vscsi-devs/dev-/. What name > > should be used to reference the devices? Also just "devid" even if it > > refers to devices "private" to the vscsi host? > Not sure. PCI uses vdevfn, which by extension would be vdevid here > (assuming I've understood what you are suggesting correctly and > therefore the analogy is valid). After a quick grep its not clear what vdevfn represents. Will study that code later. libxl_device_pci indicates that single_host:many_devices is not used for PCI. > Or could it be the case that there is no need to expose this value to > the user in the first place and libxl could just make up the index > numbers internally? Why would they want to configure it or retrieve it? I think the actual number is internal to the backend/frontend. Lets see -- the layout in the backend node is: //vscsi-devs/dev-/{p-dev,v-dev,state} N is libxl_device_vscsi->devid, just as every other backend. M is libxl_device_vscsi->vscsi_devs->vscsi_dev_id. One N can have several M (single host, many devices) which is different to all other backends. I think the issue is that if two M exists and 'scsi-detach' removes M==0 the next time something walks //vscsi-devs/ it will find just a single entry with M==1. So this number has to be recorded. > Is it actually the same as the offset into the vscsi_devs array? Per the above it can not be the offset, the code has to handle holes. > How is it intended to be different from the vdev field? The vdev field is used to group several devices into a virtual controller. The HOST in HOST:CHN:TGT:LUN matters. In this sense the vscsi_dev_id is unrelated to the vdev field. Olaf