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

Re: [Xen-devel] [PATCH v5 5/7] libxl: allow creation of domains with a specified or random domid



On Fri, Jan 31, 2020 at 10:02 AM Paul Durrant <pdurrant@xxxxxxxxxx> wrote:
>
> This patch adds a 'domid' field to libxl_domain_create_info and then
> modifies libxl__domain_make() to have Xen use that value if it is valid.
> If the domid value is invalid then Xen will choose the domid, as before,
> unless the value is the new special RANDOM_DOMID value added to the API.
> This value instructs libxl__domain_make() to choose a random domid value
> for Xen to use.
>
> If Xen determines that a domid specified to or chosen by
> libxl__domain_make() co-incides with an existing domain then the create
> operation will fail. In this case, if RANDOM_DOMID was specified to
> libxl__domain_make() then a new random value will be chosen and the create
> operation will be re-tried, otherwise libxl__domain_make() will fail.
>
> After Xen has successfully created a new domain, libxl__domain_make() will
> check whether its domid matches any recently used domid values. If it does
> then the domain will be destroyed. If the domid used in creation was
> specified to libxl__domain_make() then it will fail at this point,
> otherwise the create operation will be re-tried with either a new random
> or Xen-selected domid value.
>
> NOTE: libxl__logv() is also modified to only log valid domid values in
>       messages rather than any domid, valid or otherwise, that is not
>       INVALID_DOMID.
>
> Signed-off-by: Paul Durrant <pdurrant@xxxxxxxxxx>

Looks good, with one suggestion below.

Reviewed-by: Jason Andryuk <jandryuk@xxxxxxxxx>

<snip>

> +
> +            /* Try to destroy the domain again as we can't use it */
> +            ret = xc_domain_destroy(ctx->xch, *domid);
> +            if (ret < 0) {
> +                LOGED(ERROR, *domid, "domain destroy fail");

Maybe "destroy recently used domain id failed"?

> +                *domid = INVALID_DOMID;
> +                rc = ERROR_FAIL;
> +                goto out;
> +            }
>          }
>
>          rc = libxl__arch_domain_save_config(gc, d_config, state, &create);

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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