Jeremy Fitzhardinge
2011-Aug-20 00:49 UTC
[Xen-devel] [PATCH 2/2] Load gntdev and evtchn if they''re modular.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> diff -r cfb49fe940fd -r 81f75ed45ec2 tools/hotplug/Linux/init.d/xencommons --- a/tools/hotplug/Linux/init.d/xencommons Tue Aug 16 16:56:16 2011 -0700 +++ b/tools/hotplug/Linux/init.d/xencommons Tue Aug 16 17:05:18 2011 -0700 @@ -29,12 +29,18 @@ XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid shopt -s extglob -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 +# Done here if this isn''t a control domain if ! grep -q "control_d" /proc/xen/capabilities ; then exit 0 fi _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Aug-30 16:46 UTC
Re: [Xen-devel] [PATCH 2/2] Load gntdev and evtchn if they''re modular. [and 1 more messages]
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 > fiI''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 > +fiThis 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 > fiAs 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 > fiIf /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. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Olaf Hering
2011-Aug-30 18:12 UTC
Re: [Xen-devel] [PATCH 2/2] Load gntdev and evtchn if they''re modular. [and 1 more messages]
On Tue, Aug 30, Ian Jackson wrote:> > +# 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 ?It means a domU with xenlinux PV drivers loaded, in that case the script has to do nothing.> kernels really not provide that file ? Also these two ifs would be > better combined.How would that look like? First the file is not there, so grep will print an error - thats what my patch tries to fix. Second the file is there and may indicate a dom0. Olaf _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Aug-31 16:02 UTC
Re: [Xen-devel] [PATCH 2/2] Load gntdev and evtchn if they''re modular. [and 1 more messages]
Olaf Hering writes ("Re: [Xen-devel] [PATCH 2/2] Load gntdev and evtchn if they''re modular. [and 1 more messages]"):> How would that look like? First the file is not there, so grep will > print an error - thats what my patch tries to fix.If you write false && true the shell does not execute true. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Possibly Parallel Threads
- [PATCH 1/2] Make xencommons a bit more idiomatic
- Xenstore daemon is not running after boot; although can be started manually later. Any pointers why ?
- Xenstore daemon is not running after boot; although can be started manually later. Any pointers why ?
- [PATCH v2 09/15] xen/gntdev: use mmu_range_notifier_insert
- bug in xen 4.1 install on suse 11.4 (xencommons)