Jeremy Fitzhardinge
2011-Aug-20 00:49 UTC
[Xen-devel] [PATCH 1/2] Make xencommons a bit more idiomatic
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> diff -r 8d6edc3d26d2 -r cfb49fe940fd tools/hotplug/Linux/init.d/xencommons --- a/tools/hotplug/Linux/init.d/xencommons Sat Aug 13 10:14:58 2011 +0100 +++ b/tools/hotplug/Linux/init.d/xencommons Tue Aug 16 16:56:16 2011 -0700 @@ -29,11 +29,9 @@ XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid shopt -s extglob -if test "x$1" = xstart && \ - test -d /proc/xen && \ - ! test -f /proc/xen/capabilities && \ - ! grep ''^xenfs '' /proc/mounts >/dev/null; -then +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 fi _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Olaf Hering
2011-Aug-20 08:21 UTC
Re: [Xen-devel] [PATCH 1/2] Make xencommons a bit more idiomatic
On Fri, Aug 19, Jeremy Fitzhardinge wrote:> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> > > > diff -r 8d6edc3d26d2 -r cfb49fe940fd tools/hotplug/Linux/init.d/xencommons > --- a/tools/hotplug/Linux/init.d/xencommons Sat Aug 13 10:14:58 2011 +0100 > +++ b/tools/hotplug/Linux/init.d/xencommons Tue Aug 16 16:56:16 2011 -0700I think this one is more complete: http://lists.xensource.com/archives/html/xen-devel/2011-08/msg00438.html Olaf _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2011-Aug-21 00:33 UTC
Re: [Xen-devel] [PATCH 1/2] Make xencommons a bit more idiomatic
On 08/20/2011 01:21 AM, Olaf Hering wrote:> On Fri, Aug 19, Jeremy Fitzhardinge wrote: > >> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> >> >> >> diff -r 8d6edc3d26d2 -r cfb49fe940fd tools/hotplug/Linux/init.d/xencommons >> --- a/tools/hotplug/Linux/init.d/xencommons Sat Aug 13 10:14:58 2011 +0100 >> +++ b/tools/hotplug/Linux/init.d/xencommons Tue Aug 16 16:56:16 2011 -0700 > I think this one is more complete: > > http://lists.xensource.com/archives/html/xen-devel/2011-08/msg00438.html >1/2 is really just a style cleanup. 2/2 is closer to your patch, but it also modprobes evtchn/gntdev. J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Aug-30 16:41 UTC
Re: [Xen-devel] [PATCH 1/2] Make xencommons a bit more idiomatic
Jeremy Fitzhardinge writes ("[Xen-devel] [PATCH 1/2] Make xencommons a bit more idiomatic"):> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>...> -if test "x$1" = xstart && \ > - test -d /proc/xen && \ > - ! test -f /proc/xen/capabilities && \ > - ! grep ''^xenfs '' /proc/mounts >/dev/null; > -then > +if [ "x$1" = xstart -a -d /proc/xen -a \ > + ! -f /proc/xen/capabilities ] && \ > + ! grep -qw ''^xenfs'' /proc/mounts; then > mount -t xenfs xenfs /proc/xenI''m afraid I''m reluctant to accept this purely stylistic change. I might if it seemed to me to be a clear improvement, but I don''t think that''s the case. If anything we should be moving towards the use of && rather than -a, as that is harmless and will make the script depend less on /bin/bash. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2011-Aug-30 17:47 UTC
Re: [Xen-devel] [PATCH 1/2] Make xencommons a bit more idiomatic
On 08/30/2011 09:41 AM, Ian Jackson wrote:> Jeremy Fitzhardinge writes ("[Xen-devel] [PATCH 1/2] Make xencommons a bit more idiomatic"): >> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> > ... >> -if test "x$1" = xstart && \ >> - test -d /proc/xen && \ >> - ! test -f /proc/xen/capabilities && \ >> - ! grep ''^xenfs '' /proc/mounts >/dev/null; >> -then >> +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 > I''m afraid I''m reluctant to accept this purely stylistic change. I > might if it seemed to me to be a clear improvement, but I don''t think > that''s the case. > > If anything we should be moving towards the use of && rather than -a, > as that is harmless and will make the script depend less on /bin/bash.No, you''ve misread it. I''m changing it to use test for all the file-existence checks in it''s idiomatic form of ''['', which implements -a. It is not at all bash-specific. J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel