From: Wei Liu Subject: Re: [PATCH 1/7] tools/hotplug: fix conditions in systemd service files for dom0 Date: Fri, 24 Oct 2014 15:56:11 +0100 Message-ID: <20141024145611.GD21422@zion.uk.xensource.com> References: <1414160230-15131-1-git-send-email-olaf@aepfle.de> <1414160230-15131-2-git-send-email-olaf@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1414160230-15131-2-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: Olaf Hering Cc: Wei Liu , Ian Campbell , Stefano Stabellini , Ian Jackson , xen-devel@lists.xen.org, M A Young List-Id: xen-devel@lists.xenproject.org On Fri, Oct 24, 2014 at 04:17:04PM +0200, Olaf Hering wrote: > ConditionVirtualization= checks if systemd runs in some sort of guest. > It is not supposed to detect host capabilities. The current > implementation happens to work because systemd-detect-virt from v208 > returns also 'xen' in a dom0. In v210 and later 'none' is returned and > no service files will be started. > > Adjust the checks to detect a dom0 vs. native boot. Mounting xenfs > depends on /proc/xen, but should only be done for pvops because xenfs > exists only there. All other service files should not be started in > domU. The file /proc/xen/capabilities exists in both dom0 and domU in a > pvops kernel, but only in dom0 it contains 'control_d'. The existing > ExecStartPre= check will prevent starting in a domU. > > ConditionVirtualization=!xen is true in a dom0. But this check is broken > in systemd v208, so its not used. > > Signed-off-by: Olaf Hering > Cc: Ian Campbell > Cc: Ian Jackson > Cc: Stefano Stabellini > Cc: Wei Liu Acked-by: Wei Liu