From: "Luis R. Rodriguez" Subject: Re: [PATCH v5 02/14] libxenstore.so: add support for systemd Date: Wed, 21 May 2014 18:32:16 +0200 Message-ID: <20140521163216.GU13289@wotan.suse.de> References: <1400589095-3872-1-git-send-email-mcgrof@do-not-panic.com> <1400589095-3872-3-git-send-email-mcgrof@do-not-panic.com> <1400682919.4856.113.camel@kazak.uk.xensource.com> <1400684214.6516.3.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wn9RC-0000ZB-8s for xen-devel@lists.xenproject.org; Wed, 21 May 2014 16:32:18 +0000 Content-Disposition: inline In-Reply-To: <1400684214.6516.3.camel@kazak.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: Ian Campbell Cc: xen-devel@lists.xenproject.org, "Luis R. Rodriguez" List-Id: xen-devel@lists.xenproject.org On Wed, May 21, 2014 at 03:56:54PM +0100, Ian Campbell wrote: > On Wed, 2014-05-21 at 15:35 +0100, Ian Campbell wrote: > > > > + > > > +/* > > > + * We list stdin, stdout and stderr simply for documentation purposes > > > + * and to help our array size fit the number of expected sockets we > > > + * as sd_listen_fds() will return 5 for example if you set the socket > > > + * service with 2 sockets. > > > > Please can we get rid of this list (which is bad enough in itself but > > the three spurious entries are ludicrous) and just > > #define SOCKET_RW_INDEX SD_LISTEN_FDS_START > > #define SOCKET_RO_INDEX SDL_LISTEN_FDS_START + 1 > > etc and use those for lookups, as I described in > > <1399971222.11314.27.camel@kazak.uk.xensource.com>? > > Also I thought that we decided that the mapping from the indexes here to > the functionality need to be documented as well, I'm not seeing that, at > least not based on a skim of the other subject lines in this series. I didn't like the #define approach so wanted to pitch it again under new usage, I'll be sure to add something once a final approach is decided. Please note that another reason for tucking things away under a list and library was to *eventually* remove the different definitions of these socket's paths. That code is already split up but can be brought together under libxenstore and for the systemd case the list can be used to to do an O(1) lookup of the socket path in the list. If we use just #defines we would just be adding more #defines for other things other than the file descriptor for systemd, we'd have it also for mode, and paths. The list therefore seemed more attractive. Let me know. Luis