From: Ian Jackson Subject: Re: [PATCH v3 7/7] libxl__device_disk_local_attach: wait for state "connected" Date: Tue, 17 Apr 2012 19:01:56 +0100 Message-ID: <20365.45076.153077.759249@mariner.uk.xensource.com> References: <1334601190-14187-7-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: <1334601190-14187-7-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.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org Stefano Stabellini writes ("[Xen-devel] [PATCH v3 7/7] libxl__device_disk_local_attach: wait for state "connected""): > In order to make sure that the block device is available and ready to be > used, wait for state "connected" in the backend before returning. ... > + be_path = libxl__device_backend_path(gc, &device); > + rc = libxl__wait_for_backend(gc, be_path, "4"); Ideally we shouldn't be introducing new calls to functions called "libxl__wait_for". Although I appreciate you may not want to convert libxl__device_disk_local_attach and all its callers to use callbacks. > + if (rc < 0) { > + libxl__device_disk_local_detach(gc, tmpdisk); > + return NULL; Again, this is the "free something on every exit path" error handling style. Surely we should have a "goto out" or "goto out_err" or something ? Ian.