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

Re: [Xen-devel] [PATCH 1 of 3] libxl: extend pCPUs specification for vcpu-pin.

Dario Faggioli writes ("[Xen-devel] [PATCH 1 of 3] libxl: extend pCPUs 
specification for vcpu-pin."):
> Allow for "^<cpuid>" syntax while specifying the pCPUs list
> during a vcpu-pin. This enables doing the following:
>  xl vcpu-pin 1 1 0-4,^2
> +    if (strcmp(cpu, "all")) {
> +        for (toka = strtok(cpu, ","), i = 0; toka; toka = strtok(NULL, ","), 
> ++i) {

OMG you used strtok.  strtok is not thread-safe.  strtok_r is but
still modifies its input string - hence your need to strdup.  If you
do want to do it this way IMO the strdup should be in vcpupin_parse
which should take a const char*.  Are you sure this is the right
approach to parsing this ?

<record type="broken">
Your patch 2 has a number of overly long lines.


Xen-devel mailing list



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