Make xencommons a bit more idiomatic
PATCH 1/2 Make xencommons a bit more idiomatic
tools/hotplug/Linux/init.d/xencommons +3 -5
@@ -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
tools/hotplug/Linux/init.d/xencommons
Quoted 6 lines · Jeremy Fitzhardinge
Signed-off-by Jeremy Fitzhardinge <[email protected]>diff -r
8d6edc3d26d2-rcfb49fe940fdtools/hotplug/Linux/init.d/xencommonstools/hotplug/Linux/init.d/xencommons +0
-0
I think this one is more complete:
http://lists.xensource.com/archives/html/xen-devel/2011-08/msg00438.html
Olaf
Quoted 5 lines · Olaf Hering
Quoted 3 lines · Jeremy Fitzhardinge
Signed-off-by Jeremy Fitzhardinge <[email protected]>
Quoted 7 lines
tools/hotplug/Linux/init.d/xencommons
Quoted 3 lines
diff -r
8d6edc3d26d2-rcfb49fe940fdtools/hotplug/Linux/init.d/xencommonstools/hotplug/Linux/init.d/xencommons +0
-0I 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
Jeremy Fitzhardinge writes ("[Xen-devel] [PATCH 1/2] Make xencommons a bit more idiomatic"):
Quoted 1 line
Signed-off-by Jeremy Fitzhardinge <[email protected]>
...
tools/hotplug/Linux/init.d/xencommons line 35
Quoted 9 lines
tools/hotplug/Linux/init.d/xencommons +3
-5-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.
Ian.
Quoted 16 lines · Ian Jackson
Jeremy Fitzhardinge writes ("[Xen-devel] [PATCH 1/2] Make xencommons a bit more idiomatic"):
Quoted 1 line
Signed-off-by Jeremy Fitzhardinge <[email protected]>...
tools/hotplug/Linux/init.d/xencommons line 35
Quoted 9 lines
tools/hotplug/Linux/init.d/xencommons +3
-5-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.
Quoted 2 lines
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