From: Ian Jackson Subject: Re: [PATCH v4 6/8] libxl: introduce libxl__alloc_vdev Date: Tue, 24 Apr 2012 16:16:34 +0100 Message-ID: <20374.50130.965539.944040@mariner.uk.xensource.com> References: <1335264358-20182-6-git-send-email-stefano.stabellini@eu.citrix.com> <20374.49036.91434.25461@mariner.uk.xensource.com> <1335279876.4347.195.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1335279876.4347.195.camel@zakaz.uk.xensource.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: "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [Xen-devel] [PATCH v4 6/8] libxl: introduce libxl__alloc_vdev"): > On Tue, 2012-04-24 at 15:58 +0100, Ian Jackson wrote: > > Stefano Stabellini writes ("[Xen-devel] [PATCH v4 6/8] libxl: introduce libxl__alloc_vdev"): > > > + } while (vdev[strlen(vdev) - 1] <= 'z'); > > > > There is a scaling limit here of not starting more than 26 domains > > simultaneously. Is that acceptable ? I'm tempted to suggest not. > > While I agree we also need to start being pragmatic about ever getting > 4.2 out the door... > > If it's a trivial job to support aa, ab etc then lets do it, if not then > lets leave it for 4.3? The problem is because the code is trying to avoid too much knowledge of the devid scheme; in particular, it's trying to avoid introducing the inverse function to libxl__device_disk_dev_number. Although it /does/ depend intimately on the details of libxl__device_disk_dev_number. It is arguably a bug that libxl__device_disk_dev_number combines the parsing of vdev strings with the composition of disk/partition numbers into devids. But we can avoid needing to decompose it by passing libxl__device_disk_dev_number a format which is easier to create than one with a base-26-encoded disk number. What I would do is: * call libxl__device_disk_dev_number once on blkdev_start with non-null arguments for pdisk and ppartition; check that the partition is 0. * loop incrementing the disk value * on each iteration, - generate a vdev = GCSPRINTF("d%d", disk); - use libxl__device_disk_dev_number on that vdev to get the devid - check whether this devid is available Ian.