From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harmandeep Kaur Subject: Re: [PATCH 3/3] xl: convert cpupool related return codes to EXIT_[SUCCESS|FAILURE] Date: Fri, 23 Oct 2015 18:03:48 +0530 Message-ID: References: <1445586491-15093-1-git-send-email-write.harmandeep@gmail.com> <1445586491-15093-3-git-send-email-write.harmandeep@gmail.com> <1445602257.5117.115.camel@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0488834586903402432==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZpbXc-0003kT-Tq for xen-devel@lists.xenproject.org; Fri, 23 Oct 2015 12:33:53 +0000 Received: by iow1 with SMTP id 1so11844653iow.1 for ; Fri, 23 Oct 2015 05:33:48 -0700 (PDT) In-Reply-To: <1445602257.5117.115.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: stefano.stebellini@eu.citrix.com, wei.liu2@citrix.com, Ian Campbell , ian.jackson@eu.citrix.com, George Dunlap , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org --===============0488834586903402432== Content-Type: multipart/alternative; boundary=001a113fee64c22b8b0522c4d20f --001a113fee64c22b8b0522c4d20f Content-Type: text/plain; charset=UTF-8 On Fri, Oct 23, 2015 at 5:40 PM, Dario Faggioli 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@lists.xen.org/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 > -- > <> (Raistlin Majere) > ----------------------------------------------------------------- > Dario Faggioli, Ph.D, http://about.me/dario.faggioli > Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) > > --001a113fee64c22b8b0522c4d20f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Fri, Oct 23, 2015 at 5:40 PM, Dario Faggioli <<= a href=3D"mailto:dario.faggioli@citrix.com" target=3D"_blank">dario.faggiol= i@citrix.com> wrote:
>=C2=A0 int main_cpupooldestroy(int argc, char **argv)
> @@ -7580,13 +7580,13 @@ int main_cpupooldestroy(int argc, char
> **argv)
>=C2=A0 =C2=A0 =C2=A0 if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool= , &poolid,
> NULL) ||
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 !libxl_cpupoolid_is_valid(ctx, pooli= d)) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr, "unknown cpupoo= l '%s'\n", pool);
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 return 1;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 return EXIT_FAILURE;
>=C2=A0 =C2=A0 =C2=A0 }
>
>=C2=A0 =C2=A0 =C2=A0 if (libxl_cpupool_destroy(ctx, poolid))
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 return 1;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 return EXIT_FAILURE;
>
> -=C2=A0 =C2=A0 return 0;
> +=C2=A0 =C2=A0 return EXIT_SUCCESS;
>=C2=A0 }
>
For this one: I've sent a patch for another reason yesterday, an= d 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.

=C2=A0https://www.mail-archive.com= /xen-devel@lists.xen.org/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:

=C2=A0http://wiki.xenproject.org/wiki/Xen_Pr= oject_Repositories=C2=A0=C2=A0

I was on= master branch, now switching to staging.

Thank you so mu= ch 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) >
>=C2=A0 out:
>=C2=A0 =C2=A0 =C2=A0 libxl_bitmap_dispose(&cpumap);
> -=C2=A0 =C2=A0 return rc;
> +=C2=A0 =C2=A0 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)
>
>=C2=A0 out:
>=C2=A0 =C2=A0 =C2=A0 libxl_bitmap_dispose(&cpumap);
> -=C2=A0 =C2=A0 return rc;
> +=C2=A0 =C2=A0 return rc ? EXIT_FAILURE : EXIT_SUCCESS;
>
And here.

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

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


--001a113fee64c22b8b0522c4d20f-- --===============0488834586903402432== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============0488834586903402432==--