All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 3 of 3] [xen-detect] Add arguments to print out only outputs we are interested in
Date: Tue, 22 Dec 2009 15:26:03 -0500	[thread overview]
Message-ID: <20091222202603.GB11542@phenom.dumpdata.com> (raw)
In-Reply-To: <C756DABA.5191%keir.fraser@eu.citrix.com>

On Tue, Dec 22, 2009 at 08:21:14PM +0000, Keir Fraser wrote:
> On 22/12/2009 16:48, "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com> wrote:
> 
> > # HG changeset patch
> > # User konrad@phenom.dumpdata.com
> > # 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!

Wrong combination. Here is what the Dracut maintainer suggested:

[konrad@phenom ~]$ if xen-detect; then echo blah; fi
Not running on Xen.
blah

Which is not what I wanted it to do. Having the -N, -P, -H arguments
fixed the issue.

> 
> 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?

That should do it. Will post a rework after the X-mas holidays.

  reply	other threads:[~2009-12-22 20:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-22 16:48 [PATCH 0 of 3] Patches when Linux Xen drivers are modules Konrad Rzeszutek Wilk
2009-12-22 16:48 ` [PATCH 1 of 3] If Xen backend modules are not loaded, load them before starting Xend Konrad Rzeszutek Wilk
2009-12-22 19:41   ` Ian Campbell
2009-12-22 19:57     ` Konrad Rzeszutek Wilk
2009-12-22 21:59       ` Ian Campbell
2009-12-22 16:48 ` [PATCH 2 of 3] [xen-detect] Return 0 if no Xen detected; 1 if running in PV context; and 2 if in HVM context Konrad Rzeszutek Wilk
2009-12-22 20:16   ` Keir Fraser
2009-12-22 16:48 ` [PATCH 3 of 3] [xen-detect] Add arguments to print out only outputs we are interested in Konrad Rzeszutek Wilk
2009-12-22 20:21   ` Keir Fraser
2009-12-22 20:26     ` Konrad Rzeszutek Wilk [this message]
2009-12-22 20:38       ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091222202603.GB11542@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.