* [PATCH 1/2] Make xencommons a bit more idiomatic
@ 2011-08-20 0:49 Jeremy Fitzhardinge
2011-08-20 8:21 ` Olaf Hering
2011-08-30 16:41 ` Ian Jackson
0 siblings, 2 replies; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2011-08-20 0:49 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel@lists.xensource.com
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] Make xencommons a bit more idiomatic
2011-08-20 0:49 [PATCH 1/2] Make xencommons a bit more idiomatic Jeremy Fitzhardinge
@ 2011-08-20 8:21 ` Olaf Hering
2011-08-21 0:33 ` Jeremy Fitzhardinge
2011-08-30 16:41 ` Ian Jackson
1 sibling, 1 reply; 5+ messages in thread
From: Olaf Hering @ 2011-08-20 8:21 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: xen-devel@lists.xensource.com, Ian Jackson
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
Olaf
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] Make xencommons a bit more idiomatic
2011-08-20 8:21 ` Olaf Hering
@ 2011-08-21 0:33 ` Jeremy Fitzhardinge
0 siblings, 0 replies; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2011-08-21 0:33 UTC (permalink / raw)
To: Olaf Hering; +Cc: xen-devel@lists.xensource.com, Ian Jackson
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] Make xencommons a bit more idiomatic
2011-08-20 0:49 [PATCH 1/2] Make xencommons a bit more idiomatic Jeremy Fitzhardinge
2011-08-20 8:21 ` Olaf Hering
@ 2011-08-30 16:41 ` Ian Jackson
2011-08-30 17:47 ` Jeremy Fitzhardinge
1 sibling, 1 reply; 5+ messages in thread
From: Ian Jackson @ 2011-08-30 16:41 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: xen-devel@lists.xensource.com
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.
Ian.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 1/2] Make xencommons a bit more idiomatic
2011-08-30 16:41 ` Ian Jackson
@ 2011-08-30 17:47 ` Jeremy Fitzhardinge
0 siblings, 0 replies; 5+ messages in thread
From: Jeremy Fitzhardinge @ 2011-08-30 17:47 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel@lists.xensource.com
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-08-30 17:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-20 0:49 [PATCH 1/2] Make xencommons a bit more idiomatic Jeremy Fitzhardinge
2011-08-20 8:21 ` Olaf Hering
2011-08-21 0:33 ` Jeremy Fitzhardinge
2011-08-30 16:41 ` Ian Jackson
2011-08-30 17:47 ` Jeremy Fitzhardinge
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.