From: Ian Jackson Subject: Re: [PATCH v2] libxenstore: prefer using the character device Date: Tue, 1 Sep 2015 12:28:08 +0100 Message-ID: <21989.35784.590403.428570@mariner.uk.xensource.com> References: <55D2FF72.7050006@citrix.com> <1440684278-16838-1-git-send-email-jonathan.creekmore@gmail.com> <20150827165643.GU22586@zion.uk.xensource.com> <21983.20700.957792.401545@mariner.uk.xensource.com> <55E03089.7080009@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZWjjZ-0001AO-6T for xen-devel@lists.xenproject.org; Tue, 01 Sep 2015 11:28:13 +0000 In-Reply-To: <55E03089.7080009@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: David Vrabel Cc: Jonathan Creekmore , xen-devel@lists.xenproject.org, Wei Liu , ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org David Vrabel writes ("Re: [Xen-devel] [PATCH v2] libxenstore: prefer using the character device"): > On 27/08/15 19:03, Ian Jackson wrote: > > I confess I still see this as working around a kernel bug. Only this > > time we are switching from a buggy to non-buggy kernel interface. > > /proc/xen/xenbus is deprecated. The tools should use the non-deprecated > interface. Why don't we just change it, then ? What kernels don't provide /dev/xen/xenbus ? > > Why don't we have the kernel provide only non-buggy interfaces ? > > >>> + if (access("/dev/xen/xenbus", F_OK) == 0) > >>> + return "/dev/xen/xenbus"; > > > > Also, previously xs_domain_dev was a function which simply returned a > > static value. I feel vaguely uneasy at putting this kind of > > autodetection logic here. > > "Vaguely uneasy"? Are we engineers or witchdoctors? It doesn't fit my mental model of what this function is for. I think it would be in better taste would be to arrange to attempt to call open() on both strings. But perhaps that is too much to do at this stage of the release. > xs_domain_dev() already does a system call to query the environment so > it did not just "return a static value": getenv is not a system call. Anyway, if others don't have similar objections I am not nacking this. It may be applied with Wei's ack. Ian.