From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: Re: [PATCH 2/2] Load gntdev and evtchn if they're modular. [and 1 more messages] Date: Tue, 30 Aug 2011 17:46:06 +0100 Message-ID: <20061.5070.515745.853827@mariner.uk.xensource.com> References: <0e95f2c754bf526a89bb.1313133119@probook.site> <20054.26388.743123.491778@mariner.uk.xensource.com> <20110825152413.GB25643@aepfle.de> <20054.27534.720259.973323@mariner.uk.xensource.com> <20110826091055.GA495@aepfle.de> <4E4F0483.8070007@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4E4F0483.8070007@goop.org>, <20110826091055.GA495@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Olaf Hering , Jeremy Fitzhardinge Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Jeremy Fitzhardinge writes ("[Xen-devel] [PATCH 2/2] Load gntdev and evtchn if they're modular."): > -if [ "x$1" = xstart -a -d /proc/xen -a \ > - ! -f /proc/xen/capabilities ] && \ > - ! grep -qw '^xenfs' /proc/mounts; then > - mount -t xenfs xenfs /proc/xen > +[ -d /proc/xen ] || exit 0 # Xen not present; exit quietly > + > +if [ "x$1" = xstart ]; then > + # Mount /proc/xen if needed > + [ -f /proc/xen/capabilities ] || mount -t xenfs xenfs /proc/xen > + > + # Make sure evtchn and gntdev are loaded if present > + grep -q "xen/evtchn" /proc/misc || modprobe xen-evtchn > + grep -q "xen/gntdev" /proc/misc || modprobe xen-gntdev > fi I'd be inclined to accept this although because I didn't like your previous patch, it doesn't apply. Olaf Hering writes ("[Xen-devel] [PATCH v2] hotplug: update xencommons script to run only when needed"): > +# not running in Xen dom0 or domU > +if ! test -d /proc/xen ; then > + exit 0 > +fi This part is fine. > +# mount xenfs in dom0 or domU with a pv_ops kernel > if test "x$1" = xstart && \ > - test -d /proc/xen && \ Fine. > ! test -f /proc/xen/capabilities && \ > - ! grep '^xenfs ' /proc/mounts >/dev/null; > + ! grep -q '^xenfs ' /proc/mounts ; > then > mount -t xenfs xenfs /proc/xen > fi As I said to Jeremy, I'm not sure I want style changes. I'm not convinced of the huge usefulness of this one either. > +# run this script only in dom0: > +# no capabilities file in xenlinux kernel > +if ! test -f /proc/xen/capabilities ; then > + exit 0 > +fi > +# empty capabilities file in pv_ops kernel > if ! grep -q "control_d" /proc/xen/capabilities ; then > exit 0 > fi If /proc/xen/capabilities is missing, what does it mean ? Do domU kernels really not provide that file ? Also these two ifs would be better combined. Ian.