WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 3 of 3] [xen-detect] Add arguments to print out o

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 3 of 3] [xen-detect] Add arguments to print out only outputs we are interested in
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Tue, 22 Dec 2009 20:21:14 +0000
Cc:
Delivery-date: Tue, 22 Dec 2009 12:21:53 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <04c067941b17bdc679ff.1261500538@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcqDPEefvEQiOJDCRWe83/JqgOQrBAACAdg+
Thread-topic: [PATCH 3 of 3] [xen-detect] Add arguments to print out only outputs we are interested in
User-agent: Microsoft-Entourage/12.23.0.091001
On 22/12/2009 16:48, "Konrad Rzeszutek Wilk" <konrad.wilk@xxxxxxxxxx> wrote:

> # HG changeset patch
> # User konrad@xxxxxxxxxxxxxxxxxxx
> # Date 1261498156 18000
> # Node ID 04c067941b17bdc679ffdc2f6c81f8e2f78e9cc5
> # Parent  7bd805a543da685a3dba7b8b0c4e3e7052c863b3
> [xen-detect] Add arguments to print out only outputs we are interested in.
> 
> This is quite usefull in scripts where you can do
> if xen-detect -P || modprobe xen-<some module>
> 
> And do not have to parse the output - instead you will get
> the output only if the condition exists.

Er, what? The above shell fragment is affected by the value returned by
xen-detect (0 versus non-0), not by whether it prints something!

Here is my suggestion: keep your new command-line options, but instead of
affecting printing, have them affect the return value. E.g., -P causes
return 0 if running PV, else return 1. Further, we can add a -q option to
quiesce normal output from xen-detect, to make it quieter for use in shell
scripts.

E.g, xen-detect -Pq && modprobe some-xen-pv-specific-module

What do you think of that?

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel