[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] libxl: set guest_domid even if libxl__domain_make fails



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.jackson@xxxxxxxxxxxxx>

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.