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

Re: [Xen-devel] [PATCH v3 2/2] libxl: Use QMP cpu-add to hotplug CPU with qemu-xen.



On Mon, Jun 24, 2013 at 2:33 PM, Anthony PERARD
<anthony.perard@xxxxxxxxxx> wrote:
> -int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap 
> *cpumap)
> +static int libxl__set_vcpuonline_xenstore(libxl__gc *gc, uint32_t domid,
> +                                         libxl_bitmap *cpumap)
[snip]
>  retry_transaction:
> -    t = xs_transaction_start(ctx->xsh);
> +    t = xs_transaction_start(CTX->xsh);
>      for (i = 0; i <= info.vcpu_max_id; i++)
>          libxl__xs_write(gc, t,
>                         libxl__sprintf(gc, "%s/cpu/%u/availability", dompath, 
> i),
>                         "%s", libxl_bitmap_test(cpumap, i) ? "online" : 
> "offline");

[snip]

> +static int libxl__set_vcpuonline_qmp(libxl__gc *gc, uint32_t domid,
> +                                     libxl_bitmap *cpumap)
> +{
> +    libxl_dominfo info;
> +    int i, rc = 0;
> +
> +    if (libxl_domain_info(CTX, &info, domid) < 0) {
> +        LOGE(ERROR, "getting domain info list");
> +        rc = ERROR_FAIL;
> +        goto out;
> +    }
> +    for (i = 0; i <= info.vcpu_max_id; i++) {
> +        if (libxl_bitmap_test(cpumap, i)) {
> +            rc = libxl__qmp_cpu_add(gc, domid, i);
> +        }

It looks like the xenstore version will both online and offline cpus
-- this seems to only add them.

If the qemu-traditional one really does successfully offline vcpus, I
don't think we can take this as-is, as it would mean that
libxl_set_vcpuonline() would have different functionality based on
what version of the device model you're using (and if we ever fix it
later, what version of the library you're using).

 -George

_______________________________________________
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®.