From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH RFC v1 2/4] xl for rt scheduler Date: Fri, 11 Jul 2014 17:07:07 +0200 Message-ID: <1405091227.29306.463.camel@Solace> References: <1405054198-29106-1-git-send-email-mengxu@cis.upenn.edu> <1405054198-29106-3-git-send-email-mengxu@cis.upenn.edu> <20140711110206.GD12584@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5591615315077305553==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Meng Xu Cc: Wei Liu , Ian Campbell , Sisu Xi , Stefano Stabellini , George Dunlap , Ian Jackson , "xen-devel@lists.xen.org" , Meng Xu , Chong Li , Dagaen Golomb List-Id: xen-devel@lists.xenproject.org --===============5591615315077305553== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-dRgdAJHk4QJgi9tWVm1I" --=-dRgdAJHk4QJgi9tWVm1I Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On ven, 2014-07-11 at 10:59 -0400, Meng Xu wrote: > > + libxl_domain_sched_params_init(&scinfo); > > + rc =3D sched_domain_get(LIBXL_SCHEDULER_RT, domid, > &scinfo); > > + if (rc) > > + return rc; > > + > =E2=80=8BThank you very much for pasting the rules here! I really appreci= ate > it. However, I didn't quite get why it violate the libxl type paradigm > and how I should correct it. (Sorry. :-()=E2=80=8B >=20 <> While, above, you're exiting, if rc is true, without calling dispose. It depens a lot on the function, but what you usually do, is grouping the calls to the various dispose under a label (typically 'out:') and goto there to exit. Look around, both in xl and libxl, you'll find plenty of examples of that. > We actually followed the way credit scheduler does > in main_sched_credit(int argc, char **argv) >=20 >=20 > } else { /* set credit scheduler paramaters */ > libxl_domain_sched_params scinfo; > libxl_domain_sched_params_init(&scinfo); > scinfo.sched =3D LIBXL_SCHEDULER_CREDIT; > if (opt_w) > scinfo.weight =3D weight; > if (opt_c) > scinfo.cap =3D cap; > rc =3D sched_domain_set(domid, &scinfo); > libxl_domain_sched_params_dispose(&scinfo); >=20 And in fact, here's dispose! :-) Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-dRgdAJHk4QJgi9tWVm1I Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlO//ZsACgkQk4XaBE3IOsRjtQCgp3jy460LPRq8HMYdrbQdf/Ea ym8AmwWTeCFlmBO/qzhlSiJnrXC6rUF4 =LiZW -----END PGP SIGNATURE----- --=-dRgdAJHk4QJgi9tWVm1I-- --===============5591615315077305553== 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 --===============5591615315077305553==--