From: Mark Pryor Subject: Re: [PATCH RFC 2/3] systemd: add xen-init-dom0 service Date: Mon, 20 Oct 2014 13:49:56 -0700 Message-ID: <1413838196.61220.YahooMailNeo@web162402.mail.bf1.yahoo.com> References: <1413817309-4884-1-git-send-email-wei.liu2@citrix.com> <1413817309-4884-3-git-send-email-wei.liu2@citrix.com> <1413831206.97460.YahooMailNeo@web162405.mail.bf1.yahoo.com> <20141020202759.GA21346@zion.uk.xensource.com> Reply-To: Mark Pryor Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20141020202759.GA21346@zion.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: Wei Liu Cc: "olaf@aepfle.de" , "mcgrof@do-not-panic.com" , "ian.jackson@eu.citrix.com" , "ian.campbell@citrix.com" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Wei, removing the 2 lines in xenstored.service was key to let xen-init-dom0 do the right thing. The JSON file is now created at Xen start (before Xendomains starts). I tested it by direct edits to systemd service file without a new build. `xl list -l 0` also gives the expected results. In logs, its different now (no more `dom0 already setup`) ---------- log ---------- 13:41:05 c7dom0 xen-init-dom0: Done setting up Dom0 13:41:05 c7dom0 systemd: Started xen-init-dom0, initialise JSON configuration stub for Dom0. ---------- snip ------- thanks for getting to the bottom of this, On Monday, October 20, 2014 1:27 PM, Wei Liu wrote: On Mon, Oct 20, 2014 at 11:53:26AM -0700, Mark Pryor wrote: > If its still RFC stage, then how can we be sure that the JSON config file for dom0 is written to /var/lib/xen? > /var/lib/xen/userdata-d.0.00000000-0000-0000-0000-000000000000.libxl-json > You can delete that file before rebooting. But this series alone won't work though. You need to remove two more lines in xenstored.service. diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in index 013e69e..e3bf837 100644 --- a/tools/hotplug/Linux/systemd/xenstored.service.in +++ b/tools/hotplug/Linux/systemd/xenstored.service.in @@ -17,8 +17,6 @@ ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities ExecStartPre=-/bin/rm -f @XEN_LIB_STORED@/tdb* ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@ ExecStart=/bin/sh -c "exec $XENSTORED --no-fork $XENSTORED_ARGS" -ExecStartPost=-@bindir@/xenstore-write "/local/domain/0/name" "Domain-0" -ExecStartPost=-@bindir@/xenstore-write "/local/domain/0/domid" 0 > If its not there by the time xendomains starts then the rest of the patch can't help. > > When I run > `xl list -l 0` > I can see the same errors. libxl is trying to open the above file and get the JSON config for dom0. If I hack a stub config into this file everything starts working as expected. I can't modify xen-init-dom0.c > > > I have no idea how to make sure its writing the above JSON config. Can someone take a look? Delete that file before rebooting. xen-init-dom0 will create one when it runs. Wei.