From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: Re: [PATCH v4 6/8] libxl: introduce libxl__alloc_vdev Date: Tue, 24 Apr 2012 15:58:20 +0100 Message-ID: <20374.49036.91434.25461@mariner.uk.xensource.com> References: <1335264358-20182-6-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1335264358-20182-6-git-send-email-stefano.stabellini@eu.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: Stefano Stabellini Cc: xen-devel@lists.xensource.com, Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org Stefano Stabellini writes ("[Xen-devel] [PATCH v4 6/8] libxl: introduce libxl__alloc_vdev"): > Introduce libxl__alloc_vdev: find a spare virtual block device in the > domain passed as argument. ... > +static char * libxl__alloc_vdev(libxl__gc *gc, uint32_t domid, > + char *blkdev_start, xs_transaction_t t) > +{ If this function is ever called with domid != our own, this will malfunction, because ... > + if (errno == ENOENT) > + return libxl__devid_to_localdev(gc, devid); ... libxl__devid_to_localdev only answers the question about the current domain. This needs to be mentioned in a documentation comment by the function, at the very least. Does your series invoke it with a domid other than our own ? > + else > + return NULL; > + } > + vdev[strlen(vdev) - 1]++; > + } 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. Note that "simultaneously" includes the case where all 27 of them are simply sat waiting for someone to press "return" on a pygrub prompt. Ian.