From: Olaf Hering Subject: [PATCH 3/7] tools/hotplug: add systemd xen-init-dom0 service Date: Fri, 24 Oct 2014 16:17:06 +0200 Message-ID: <1414160230-15131-4-git-send-email-olaf@aepfle.de> References: <1414160230-15131-1-git-send-email-olaf@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1414160230-15131-1-git-send-email-olaf@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Wei Liu , Ian Campbell , Stefano Stabellini , Ian Jackson , M A Young List-Id: xen-devel@lists.xenproject.org From: Wei Liu Also prevent xenstored.service from writing Dom0 nodes. The initialisation is now done with xen-init-dom0. Please rerun autoconf after applying this patch. Signed-off-by: Wei Liu Acked-by: Ian Campbell Cc: Ian Campbell Cc: Ian Jackson Cc: Stefano Stabellini Cc: Wei Liu --- tools/configure.ac | 1 + tools/hotplug/Linux/systemd/Makefile | 1 + tools/hotplug/Linux/systemd/xen-init-dom0.service.in | 14 ++++++++++++++ tools/hotplug/Linux/systemd/xenstored.service.in | 2 -- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/configure.ac b/tools/configure.ac index f584798..1ac63a3 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -14,6 +14,7 @@ hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount +hotplug/Linux/systemd/xen-init-dom0.service hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xen-watchdog.service hotplug/Linux/systemd/xenconsoled.service diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile index 0c40a73..51c10fe 100644 --- a/tools/hotplug/Linux/systemd/Makefile +++ b/tools/hotplug/Linux/systemd/Makefile @@ -14,6 +14,7 @@ XEN_SYSTEMD_SERVICE += xenconsoled.service XEN_SYSTEMD_SERVICE += xen-qemu-dom0-disk-backend.service XEN_SYSTEMD_SERVICE += xendomains.service XEN_SYSTEMD_SERVICE += xen-watchdog.service +XEN_SYSTEMD_SERVICE += xen-init-dom0.service ALL_XEN_SYSTEMD = $(XEN_SYSTEMD_MODULES) \ $(XEN_SYSTEMD_MOUNT) \ diff --git a/tools/hotplug/Linux/systemd/xen-init-dom0.service.in b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in new file mode 100644 index 0000000..e947760 --- /dev/null +++ b/tools/hotplug/Linux/systemd/xen-init-dom0.service.in @@ -0,0 +1,14 @@ +[Unit] +Description=xen-init-dom0, initialise Dom0 configuration (xenstore nodes, JSON configuration stub) +Requires=xenstored.socket +After=xenstored.service +ConditionPathExists=/proc/xen/capabilities + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities +ExecStart=@LIBEXEC_BIN@/xen-init-dom0 + +[Install] +WantedBy=multi-user.target diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in index 0f0d77d..45fc0f2 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 [Install] WantedBy=multi-user.target