From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH for-4.6 v2 1/4] cxenstored: fix systemd socket activation Date: Tue, 11 Aug 2015 13:46:25 +0100 Message-ID: <1439297185.9747.237.camel@citrix.com> References: <1439193619-28833-1-git-send-email-wei.liu2@citrix.com> <1439193619-28833-2-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZP8wm-0000TG-WC for xen-devel@lists.xenproject.org; Tue, 11 Aug 2015 12:46:29 +0000 In-Reply-To: <1439193619-28833-2-git-send-email-wei.liu2@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: Wei Liu , Xen-devel Cc: Ian Jackson List-Id: xen-devel@lists.xenproject.org On Mon, 2015-08-10 at 09:00 +0100, Wei Liu wrote: > There were two problems with original code: > > 1. sd_booted() was used to determined if the process was started by > systemd, which was wrong. > 2. Exit with error if pidfile was specified, which was too harsh. > > These two combined made cxenstored unable to start by hand if it ran > on a system which had systemd. > > Fix issues with following changes: > > 1. Use sd_listen_fds to determine if the process is started by systemd. > 2. Don't exit if pidfile is specified. > > Rename function and restructure code to make things clearer. > > A side effect of this patch is that gcc 4.8 with -Wmaybe-uninitialized > in non-debug build spits out spurious warning about sock and ro_sock > might be uninitialized. Since CentOS 7 ships gcc 4.8, we need to work > around that by setting sock and ro_sock to NULL at the beginning of > main. > > Signed-off-by: Wei Liu > Tested-by: George Dunlap Acked-by: Ian Campbell