From: Ian Jackson Subject: Re: [PATCH RFC 7/9] libxl: introduce specific error codes in libxl_device_disk_add Date: Wed, 24 Jun 2015 16:28:24 +0100 Message-ID: <21898.52376.948564.680919@mariner.uk.xensource.com> References: <1435153656-19485-1-git-send-email-rob.hoes@citrix.com> <1435153656-19485-8-git-send-email-rob.hoes@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z7mbN-0007HZ-JE for xen-devel@lists.xenproject.org; Wed, 24 Jun 2015 15:28:37 +0000 In-Reply-To: <1435153656-19485-8-git-send-email-rob.hoes@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: Rob Hoes Cc: euan.harris@citrix.com, xen-devel@lists.xenproject.org, Ian.Jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org Rob Hoes writes ("[PATCH RFC 7/9] libxl: introduce specific error codes in libxl_device_disk_add"): > Signed-off-by: Rob Hoes ... > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > index f622981..2f56c6e 100644 > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -2008,9 +2008,16 @@ static int libxl__device_nextid(libxl__gc *gc, uint32_t domid, char *device) > static int libxl__resolve_domid(libxl__gc *gc, const char *name, > uint32_t *domid) > { > + int rc; > if (!name) > return 0; > - return libxl_domain_qualifier_to_domid(CTX, name, domid); > + > + rc = libxl_domain_qualifier_to_domid(CTX, name, domid); > + > + if (rc < 0) > + return ERROR_DOMAIN_NOTFOUND; > + else > + return rc; This doesn't seem right. You're smashing all the errors to domain not found. Surely libxl_domain_qualifier_to_domid should return the right error to start with. The rest looks plausible (modulo my quibbles about names in my earlier mails). Ian.