From mboxrd@z Thu Jan 1 00:00:00 1970 From: Doug Goldstein Subject: Re: [PATCHv2] 1/3] libxc: prefer using privcmd character device Date: Tue, 1 Dec 2015 13:08:30 -0600 Message-ID: <565DF02E.4010104@cardoe.com> References: <1448396047-15913-1-git-send-email-cardoe@cardoe.com> <1448970397.15768.112.camel@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3426521937440564846==" Return-path: In-Reply-To: <1448970397.15768.112.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: Ian Campbell , xen-devel@lists.xen.org Cc: Wei Liu , Ian Jackson , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============3426521937440564846== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="c89RROI9GeVlMEuBvPbBHbbx7DTdrXQC3" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --c89RROI9GeVlMEuBvPbBHbbx7DTdrXQC3 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 12/1/15 5:46 AM, Ian Campbell wrote: > On Tue, 2015-11-24 at 14:14 -0600, Doug Goldstein wrote: >> Prefer using the character device over the proc file if the character >> device exists. This follows similar conversions of xenbus to avoid >> issues with FMODE_ATOMIC_POS added in Linux 3.14 and newer. >> >> CC: Ian Jackson >> CC: Stefano Stabellini >> CC: Ian Campbell >> CC: Wei Liu >> Signed-off-by: Doug Goldstein >> --- >> tools/libxc/xc_linux_osdep.c | 9 ++++++++- >> 1 file changed, 8 insertions(+), 1 deletion(-) >> >> diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep= =2Ec >> index 76c55ff..c078b3d 100644 >> --- a/tools/libxc/xc_linux_osdep.c >> +++ b/tools/libxc/xc_linux_osdep.c >> @@ -46,7 +46,14 @@ >> static xc_osdep_handle linux_privcmd_open(xc_interface *xch) >> { >> int flags, saved_errno; >> - int fd =3D open("/proc/xen/privcmd", O_RDWR); >> + int fd =3D open("/dev/xen/privcmd", O_RDWR); /* prefer this newer= >> interface */ >> + >> + if ( fd =3D=3D -1 && ( errno =3D=3D ENOENT || errno =3D=3D ENXIO = || >> + errno =3D=3D ENODEV || errno =3D=3D EACCES )) >=20 > This adds EACCESS to the set Ian suggested would be tolerable in his re= ply > to v1. I'm leaning towards thinking that if the device is present but n= ot > openable by the current user then that's a system configuration error w= hich > should be reported. >=20 > Anyone want to argue otherwise? >=20 I'll drop EACCES. I was just trying to be proactive for another possible error. --=20 Doug Goldstein --c89RROI9GeVlMEuBvPbBHbbx7DTdrXQC3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0 iQJ8BAEBCgBmBQJWXfAwXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNTM5MEQ2RTNFMTkyNzlCNzVDMzIwOTVB MkJDMDNEQzg3RUQxQkQ0AAoJEKK8A9yH7RvUFhsQAJdOo71DYMLtekKnd8DT73ra i/FCF2JnnVSlfxIYRB183A5hs+cBCpoXu7ZzC8e1D8pb+twES+qNNIs/ARs79BrS 7po/TLghtPYsBOyco6XYwG+QzgIZm2h6sQAYQ5hIM0kMo0rSdpuKAf7IoL3JjOVm EGe85Jd/ibpueS6EzrGGb3o7QWLJ69P3z+HIQfIJYnW4a0LdYw59piAiX8c26TWl Xg4ni3jwTWOIj8YEPGJRnu6LNXW3WI6LeIqC3svTquPFsIzd5vlGHcjZ5gsyPDLR xmmm45bAeYDJCvhddEj1pmQx9CbdQD9EnG1fJEF5STs43HW27XxHlWYsnWdKlPi7 l4UazEMOdgGZ/O8nmRMDM+SVGgpLvw4krf7gBZI2pIUCmZj5w+Skfwd79Bakb8/1 3o9iWOVGmxaqiKeCcXHz4yTFpKSqIOWza+TFUc/saZNNW3hy4TsTMPcXx1UA+B0s X9lgPpb4muIr+Pb6RyTvEswhJPHH5d7uHoCOs/OwpzIKZCw1uumaS8r+XI4Qh0ew iw4rEBgHCaTJnzMvqalfcclUzl+66yZnS+ZE6o51t0/Z9tLLktj5s+EcyWabR/nt tPC/6mWfRAuijGocifQrmBEocaF3VL1BiYbC8f/fQoWfnpM6LIM0Jbd6VkMxF80H 0qQ/mxdHQ93PQimH5WJK =nNIh -----END PGP SIGNATURE----- --c89RROI9GeVlMEuBvPbBHbbx7DTdrXQC3-- --===============3426521937440564846== 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 --===============3426521937440564846==--