From: Wei Liu Subject: Re: [PATCH v7 2/8] cxenstored: add support for systemd active sockets Date: Thu, 6 Aug 2015 10:20:54 +0100 Message-ID: <20150806092054.GH15719@zion.uk.xensource.com> References: <1405639699-13494-1-git-send-email-mcgrof@do-not-panic.com> <1405639699-13494-3-git-send-email-mcgrof@do-not-panic.com> <1438769878.9747.47.camel@citrix.com> <20150805131758.GM26074@zion.uk.xensource.com> <20150805172437.GA15719@zion.uk.xensource.com> <20150805181920.GB15719@zion.uk.xensource.com> <1438852396.9747.123.camel@citrix.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 1ZNHMN-0003PO-7p for xen-devel@lists.xenproject.org; Thu, 06 Aug 2015 09:21:11 +0000 Content-Disposition: inline In-Reply-To: <1438852396.9747.123.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 Cc: George Dunlap , xen-devel , "Luis R. Rodriguez" , Wei Liu , "Luis R. Rodriguez" List-Id: xen-devel@lists.xenproject.org On Thu, Aug 06, 2015 at 10:13:16AM +0100, Ian Campbell wrote: > On Wed, 2015-08-05 at 19:19 +0100, Wei Liu wrote: > > On Wed, Aug 05, 2015 at 06:24:37PM +0100, Wei Liu wrote: > > [...] > > > > > > > > > > Right. I misinterpreted sd_boot. > > > > > > You patch, however, has the undesirable effect that it fails to report > > > error if xenstored is started by systemd but couldn't claim the > > > socket. I don't think this is the correct behaviour. > > > > > > After consulting with systemd manual [0], I think we should check > > > sd_listen_fds return value to determine if it is started by systemd. > > > Currently it only checks for <= 0, which covers 1) not started by > > > systemd 2) an error occurs. > > > > > > Hopefully I interpret the doc correctly this time. I will prepare a > > > patch shortly. > > > > > > Wei. > > > > > > [0] http://www.freedesktop.org/software/systemd/man/sd_listen_fds.html > > > > Patch attached. I start cxenstored by hand and it seems to works fine -- > > now it fails with other errors. > > What other errors? Are they blockers for accepting this patch? > "FATAL: Failed to initialize dom0 state: Invalid argument" Xenstored tries to initialise domain 0 state once again. That can be dealt with with a simple -D (--no-domain-init) option to stop it from doing that. With -D the restarted xenstored worked fine. Strangely the short options are not documented in help text at all. :-) > > Can you test this patch to see if it > > works? > > > > Apparently oxenstored has similar issues. If this patch works I will > > need to fix oxenstored, too. Time to test my ocaml-fu! :-/ > > Luckily it looks like most changes required will be in systemd_stubs.c! > (Probably not all through, sorry!) > More than that, I will also need to change the callsites etc. I'm looking into that at the moment. Wei.