From patchwork Thu May 12 15:29:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Goldstein X-Patchwork-Id: 9083131 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 859519F1C1 for ; Thu, 12 May 2016 15:31:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A394C2024D for ; Thu, 12 May 2016 15:31:38 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AFE4F2009C for ; Thu, 12 May 2016 15:31:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0sYW-0004jF-Mz; Thu, 12 May 2016 15:29:40 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b0sYV-0004j1-4J for xen-devel@lists.xen.org; Thu, 12 May 2016 15:29:39 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 64/30-19343-261A4375; Thu, 12 May 2016 15:29:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRWlGSWpSXmKPExsVyMfTOYd3EhSb hBoe7DCyWfFzM4sDocXT3b6YAxijWzLyk/IoE1owtMx0KDvJXXP1l1cD4iqeLkZNDSGACo8Td 3VFdjFwcLALzmCWWLXzDBOJICPSzStx40c0OUiUhECMx/8dcVgi7XOLPqf3sEN0KEr8nHAJrE BLoZpJY/WM+M0iCTUBD4smvGWwgtoiAtMS1z5cZQWxmgQKJWU+2s4DYwgJuEme3rwMbyiKgKv Fu9i2wXl4BR4knu+6xQSzTlXh47jdYDaeAk8SM53OgFgPVnF/OOoFRYAEjwypGjeLUorLUIl1 DU72kosz0jJLcxMwcXUMDY73c1OLixPTUnMSkYr3k/NxNjMCwYgCCHYxrtnseYpTkYFIS5eWr NgkX4kvKT6nMSCzOiC8qzUktPsQow8GhJMF7cgFQTrAoNT21Ii0zBxjgMGkJDh4lEd7pIGne4 oLE3OLMdIjUKUZXji2/r61l4tiy4AaQ/LTxDpDcNvUekJw3adcxJiGWvPy8VClx3i0gzQIgzR mleXCjYdF5iVFWSpiXEehYIZ6C1KLczBJU+VeM4hyMSsK8niBTeDLzSuAueAV0HBPQcdXXjUC OK0lESEk1MF7jWSUuEzKfyf3JLfsYhayVuz3X6rPIRjzv+nx41u+/Ul/2+nCbaHJumeOzdiWH E1PxrlmB/h9nLC5R9b504apMRFTDD7757a8mT/vNOlsjV2bq8+uqUjNOTf76/SeHYl5UT72xm M/rG345niqGrzxEvLJam/x8V5ms8d4dsj/zRoD1ai6H3UosxRmJhlrMRcWJANu6XJbJAgAA X-Env-Sender: cardoe@cardoe.com X-Msg-Ref: server-9.tower-31.messagelabs.com!1463066976!6966681!1 X-Originating-IP: [209.85.220.195] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26171 invoked from network); 12 May 2016 15:29:37 -0000 Received: from mail-qk0-f195.google.com (HELO mail-qk0-f195.google.com) (209.85.220.195) by server-9.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 12 May 2016 15:29:37 -0000 Received: by mail-qk0-f195.google.com with SMTP id i7so5847441qkd.1 for ; Thu, 12 May 2016 08:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cardoe.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wer8uZjmp2iQhOfuxwiNgOgBlY8KH0u1l+PDITGvlbs=; b=bEdqDD6mhxSYiECbKM0zQ99PZjWaOXasTJRDSpcac+FOiJFBZmN9s4Rzt33Y6Hpv5W YAXlAmGveRGh1M4j01mzPq993OMXqnd/Yfq8VwOdOJ6XGLR+Nl1JMKeSXPF/AzrpKAn3 UD7OaSEwj80n3v15eFHShRw0LCzERRCCUlMaM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wer8uZjmp2iQhOfuxwiNgOgBlY8KH0u1l+PDITGvlbs=; b=bMz3kXaJMeI4bXBpGv3bvqa8AUUAeevpuGFzwmz0mTx4H1hHRPhq0/SFLGTaS1fsWt Zbf8UKJJK+otJkMvUpBUaMr2eIgjYEziv5bPgL0/Ls0KO3pM4IHtQNwxGXvTa22gRlrL gfTwQ5CeFF0e7fYK4ydXJSwziJb8gA3zlolF6HslVD0QlmrKeUAZOl3ZcZvqU8Ik+U+B /qPylfBMBhVFQcXZJlMfsO0DaH4tSrlNC1Ts7HwIc+A2T/iaqY8Y8XfRWTQU7KCzfJ8Y AkG/IHZx1Hgi9y4wKa5FGYqWjSBWjmh52LUepCrSIlN1snPVonpKyBD1FLxh22Lkv1Rp KQYA== X-Gm-Message-State: AOPr4FXxCheyDAJQlABQqckB0OOpbLn8UB0gqSBHo+dzKYmGcoli4T751COeTbh+QirwKA== X-Received: by 10.37.42.23 with SMTP id q23mr4677645ybq.10.1463066976545; Thu, 12 May 2016 08:29:36 -0700 (PDT) Received: from doug-macbook.lan (c-68-34-224-206.hsd1.al.comcast.net. [68.34.224.206]) by smtp.gmail.com with ESMTPSA id o4sm7511296ywe.22.2016.05.12.08.29.35 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 12 May 2016 08:29:35 -0700 (PDT) From: Doug Goldstein To: xen-devel@lists.xen.org Date: Thu, 12 May 2016 10:29:30 -0500 Message-Id: <1463066970-39711-2-git-send-email-cardoe@cardoe.com> X-Mailer: git-send-email 2.7.4 (Apple Git-66) In-Reply-To: <1463066970-39711-1-git-send-email-cardoe@cardoe.com> References: <1463066970-39711-1-git-send-email-cardoe@cardoe.com> Cc: Wei Liu , Ian Jackson , Doug Goldstein Subject: [Xen-devel] [PATCH 2/2] xendriverdomain: don't depend on legacy /proc/xen X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP xl devd prefers to use /dev/xen/ instead of /proc/xen so the init script should use the new interface as well and drop the legacy interface. To check for support this uses /sys/hypervisor which has been present since 2.6.18 Xen kernels. Fix bad whitespace at the same time. Signed-off-by: Doug Goldstein --- tools/hotplug/Linux/init.d/xendriverdomain.in | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/tools/hotplug/Linux/init.d/xendriverdomain.in b/tools/hotplug/Linux/init.d/xendriverdomain.in index 8d4592a..830aa5b 100644 --- a/tools/hotplug/Linux/init.d/xendriverdomain.in +++ b/tools/hotplug/Linux/init.d/xendriverdomain.in @@ -27,23 +27,12 @@ test -f $xendriverdomain_config/xendriverdomain && . $xendriverdomain_config/xen XLDEVD_PIDFILE=/var/run/xldevd.pid # not running in Xen dom0 or domU -if ! test -d /proc/xen ; then +if ! grep -q '^xen' /sys/hypervisor/type ; then exit 0 fi -# mount xenfs in dom0 or domU with a pv_ops kernel -if test "x$1" = xstart && \ - ! test -f /proc/xen/capabilities && \ - ! grep '^xenfs ' /proc/mounts >/dev/null; -then - mount -t xenfs xenfs /proc/xen -fi - # run this script only in domU: -# no capabilities file in xenlinux domU kernel -# empty capabilities file in pv_ops domU kernel -if ! test -f /proc/xen/capabilities || \ - grep -q "control_d" /proc/xen/capabilities ; then +if grep -q '00000000-0000-0000-0000-000000000000' /sys/hypervisor/uuid; then exit 0 fi @@ -52,7 +41,7 @@ do_start () { ${sbindir}/xl devd --pidfile=$XLDEVD_PIDFILE $XLDEVD_ARGS } do_stop () { - echo Stopping xl devd... + echo Stopping xl devd... if read 2>/dev/null <$XLDEVD_PIDFILE pid; then kill $pid while kill -9 $pid >/dev/null 2>&1; do sleep 1; done @@ -71,7 +60,7 @@ case "$1" in echo >&2 'Reload not available; use force-reload'; exit 1 ;; force-reload|restart) - do_stop + do_stop do_start ;; *)