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

Re: [Xen-devel] [PATCH 3/3] xl: convert cpupool related return codes to EXIT_[SUCCESS|FAILURE]





On Fri, Oct 23, 2015 at 5:40 PM, Dario Faggioli <dario.faggioli@xxxxxxxxxx> wrote:
>Â int main_cpupooldestroy(int argc, char **argv)
> @@ -7580,13 +7580,13 @@ int main_cpupooldestroy(int argc, char
> **argv)
>Â Â Â if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid,
> NULL) ||
>Â Â Â Â Â !libxl_cpupoolid_is_valid(ctx, poolid)) {
>Â Â Â Â Â fprintf(stderr, "unknown cpupool '%s'\n", pool);
> -Â Â Â Â return 1;
> +Â Â Â Â return EXIT_FAILURE;
>Â Â Â }
>
>Â Â Â if (libxl_cpupool_destroy(ctx, poolid))
> -Â Â Â Â return 1;
> +Â Â Â Â return EXIT_FAILURE;
>
> -Â Â return 0;
> +Â Â return EXIT_SUCCESS;
>Â }
>
For this one: I've sent a patch for another reason yesterday, and while
there I did the exit code adjustment myself. So, update your tree and,
if my patch has been committed already, just skip this function.

Âhttps://www.mail-archive.com/xen-devel@xxxxxxxxxxxxx/msg42850.html

Which brings up a question: what git tree are you using for
development? You should stay either on master or staging branches (and
I recommend staging) of the official repository:

Âhttp://wiki.xenproject.org/wiki/Xen_Project_RepositoriesÂÂ

I was on master branch, now switching to staging.

Thank you so much for reviewing my patch and helping on this tight
timeline. And regarding your other questions (patch 1 and 2) I will be
answering as I digest all the information you just passed :)

Again, thank you Dario. I really appreciate your help.

Warmest Regards :)
Harman


> @@ -7653,7 +7653,7 @@ int main_cpupoolcpuadd(int argc, char **argv)
>
>Â out:
>Â Â Â libxl_bitmap_dispose(&cpumap);
> -Â Â return rc;
> +Â Â return rc ? EXIT_FAILURE : EXIT_SUCCESS;
>
Same as already said for main_cpupoolcreate, just us rc.

> @@ -7691,7 +7691,7 @@ int main_cpupoolcpuremove(int argc, char
> **argv)
>
>Â out:
>Â Â Â libxl_bitmap_dispose(&cpumap);
> -Â Â return rc;
> +Â Â return rc ? EXIT_FAILURE : EXIT_SUCCESS;
>
And here.

>Â int main_cpupoolnumasplit(int argc, char **argv)
> @@ -7758,7 +7758,7 @@ int main_cpupoolnumasplit(int argc, char
> **argv)
>Â Â Â poolinfo = libxl_list_cpupool(ctx, &n_pools);
>Â Â Â if (!poolinfo) {
>Â Â Â Â Â fprintf(stderr, "error getting cpupool info\n");
> -Â Â Â Â return 1;
> +Â Â Â Â return EXIT_FAILURE;
>Â Â Â }
>Â Â Â poolid = poolinfo[0].poolid;
>Â Â Â sched = poolinfo[0].sched;
> @@ -7766,13 +7766,13 @@ int main_cpupoolnumasplit(int argc, char
> **argv)
>
>Â Â Â if (n_pools > 1) {
>Â Â Â Â Â fprintf(stderr, "splitting not possible, already cpupools in
> use\n");
> -Â Â Â Â return 1;
> +Â Â Â Â return EXIT_FAILURE;
>Â Â Â }
>
>Â Â Â topology = libxl_get_cpu_topology(ctx, &n_cpus);
>Â Â Â if (topology == NULL) {
>Â Â Â Â Â fprintf(stderr, "libxl_get_topologyinfo failed\n");
> -Â Â Â Â return 1;
> +Â Â Â Â return EXIT_FAILURE;
>Â Â Â }
>
>Â Â Â if (libxl_cpu_bitmap_alloc(ctx, &cpumap, 0)) {
> @@ -7869,7 +7869,7 @@ out:
>Â Â Â libxl_dominfo_dispose(&info);
>Â Â Â free(name);
>
> -Â Â return rc;
> +Â Â return rc ? EXIT_FAILURE : EXIT_SUCCESS;
>Â }
>
And here too.

Thanks and regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


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