From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v3] dom variable error handled in Xenstore Date: Thu, 29 Oct 2015 11:11:57 +0100 Message-ID: <1446113517.28782.50.camel@citrix.com> References: <1445991143-9165-1-git-send-email-comethalley61@gmail.com> <1445994047.2937.238.camel@citrix.com> <20151029100728.GB8097@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8341753844119776757==" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZrkBf-0001aS-IK for xen-devel@lists.xenproject.org; Thu, 29 Oct 2015 10:12:03 +0000 In-Reply-To: <20151029100728.GB8097@zion.uk.xensource.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: Wei Liu , Lasya Venneti Cc: xen-devel@lists.xenproject.org, Ian Campbell , George Dunlap , Lars Kurth List-Id: xen-devel@lists.xenproject.org --===============8341753844119776757== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-UhfhdidOFZVRvypOKsC5" --=-UhfhdidOFZVRvypOKsC5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2015-10-29 at 10:07 +0000, Wei Liu wrote: > On Thu, Oct 29, 2015 at 12:42:18AM +0530, Lasya Venneti wrote: > > I must also add errno.h header to the file, I forgot to do that. I > > shall > > do so in the next version. > >=20 >=20 > Other xc functions that issue hypercall (that is, you can trace the > call chain to do_xen_hypercall) end up calling ioctl in both Linux > and > NetBSD, and they have the same behaviour to return -1 on error and > set > errno to appropriate *Xen* errno. >=20 Aha, I just wrote an email very similar to this... this is a typical example of a race condition, someone should invent spinlocks for RL !! :-D > As for xc_dom_allocate, the only failure path at the moment is malloc > failure, which would be appropriate to use ENOMEM to represent. >=20 > However if it causes too many faffs, you can just set rv to -1 and > return to caller. I think the main point is to handle the error, > either > -1 or ENOMEM is fine by me. >=20 Agreed but, I personally prefer -1, for consistency. :-) Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-UhfhdidOFZVRvypOKsC5 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 v1 iEYEABECAAYFAlYx8O0ACgkQk4XaBE3IOsQyrgCghnege0aMylPvgxSCFK5yaZRe MxYAn25RU9bb8SxEZfM7FFmaVOrLUdbv =sAK0 -----END PGP SIGNATURE----- --=-UhfhdidOFZVRvypOKsC5-- --===============8341753844119776757== 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 --===============8341753844119776757==--