From: Ian Jackson Subject: Re: [PATCH] libxl: set guest_domid even if libxl__domain_make fails Date: Fri, 4 May 2012 17:22:57 +0100 Message-ID: <20388.609.866463.305037@mariner.uk.xensource.com> References: <1336144455-45617-1-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1336144455-45617-1-git-send-email-roger.pau@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: Roger Pau Monne Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Roger Pau Monne writes ("[PATCH] libxl: set guest_domid even if libxl__domain_make fails"): > This is needed in order to perform the domain destruction if > libxl__domain_make fails. > ret = libxl__domain_make(gc, &d_config->c_info, &domid); > if (ret) { > LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot make domain: %d", ret); > + dcs->guest_domid = domid; > ret = ERROR_FAIL; > goto error_out; This is a bit odd. The documentation for libxl__domain_make says: /* from xl_create */ _hidden int libxl__domain_make(libxl__gc *gc, libxl_domain_create_info *info, uint32_t *domid); Yes, that's it. So apparently this function does actually create the domain on error ? Oh wait I see there is a doc comment but it's next to the definition. /* on entry, libxl_domid_valid_guest(domid) must be false; * on exit (even error exit), domid may be valid and refer to a domain */ So yes, that's correct. Acked-by: Ian Jackson Ian.