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

Re: [Xen-devel] [PATCH 4 of 5] Support renaming of cpupools



On Thu, 2010-12-09 at 10:51 +0000, Juergen Gross wrote:
> 
> diff -r b979d430eab7 -r fc3f33c7faa7 tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c       Thu Dec 09 11:26:37 2010 +0100
> +++ b/tools/libxl/libxl.c       Thu Dec 09 11:29:25 2010 +0100
> @@ -3809,6 +3809,46 @@ out:
>      return rc;
>  }
>  
> +int libxl_cpupool_rename(libxl_ctx *ctx, const char *name, uint32_t
> poolid)
> +{
> +    libxl__gc gc = LIBXL_INIT_GC(ctx);
> +    xs_transaction_t t;
> +    xc_cpupoolinfo_t *info;
> +    int rc;
> +
> +    info = xc_cpupool_getinfo(ctx->xch, poolid);
> +    if (info == NULL)
> +        return ERROR_NOMEM;
> +
> +    rc = ERROR_INVAL;
> +    if (info->cpupool_id != poolid)
> +        goto out;
> +
> +    rc = 0;
> +
> +    for (;;) {
> +        t = xs_transaction_start(ctx->xsh);
> +
> +        libxl__xs_write(&gc, t,
> +                        libxl__sprintf(&gc, "/local/pool/%d/name",
> poolid),
> +                        "%s", name);
> +
> +        if (xs_transaction_end(ctx->xsh, t, 0))
> +            break;
> +
> +        if (errno == EAGAIN)
> +            continue;
> +
> +        rc = ERROR_FAIL;
> +        break;
> +    }
> +
> +out:
> +    xc_cpupool_infofree(ctx->xch, info);

You need:
        libxl__free_all(&gc);



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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