WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 4 of 5] Support renaming of cpupools
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Thu, 9 Dec 2010 12:25:00 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 09 Dec 2010 04:27:00 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <fc3f33c7faa7f94c844a.1291891884@nehalem1>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <fc3f33c7faa7f94c844a.1291891884@nehalem1>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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