All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] libxl: prevent xl from running if xend	is running.
Date: Tue, 24 Apr 2012 18:07:44 +0100	[thread overview]
Message-ID: <4F96DDE0.3020708@citrix.com> (raw)
In-Reply-To: <20374.43998.471725.415493@mariner.uk.xensource.com>

Ian Jackson escribió:
> Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: prevent xl from running if xend	is running."):
>> On Tue, 2012-04-24 at 14:17 +0100, Ian Jackson wrote:
>>> Can we somehow limit this to commands that actually change things ?
>>> Having xl as a diagnostic tool even for xend-based systems is useful.
>> Perhaps a new flag in xl_cmdtable.h? Overriden by -f or -N (dry run).
>
> Yes, something like that.

Do you mean to add a new "-f" option to each command that performs 
modifications, or modifying the cmd_spec struct to add something like 
"int modifies", and check that before trying to execute the command?

>
>>>> +        if (!access(locks[i], F_OK)&&  !force_execution) {
>>>> +            fprintf(stderr, "xend is running, which prevents xl from working "
>>>> +                            "correctly. If you still want to force the "
>>>> +                            "execution of xl please use the -f option\n");
>>>> +            exit(2);
>>>> +        }
>>> If access fails with an unexpected error code (EACCES? EIO?) this will
>>> blunder on.
>> It'll fail whether the error code is expected or not, won't it?
>
> I think if access fails with EIO, it will return -1, and the if
> condition will not be satisfied (!-1 = 0), so the fprintf and exit
> will not be taken.
>
> Ian.

  parent reply	other threads:[~2012-04-24 17:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 15:11 [PATCH] libxl: prevent xl from running if xend is running Roger Pau Monne
2012-04-23 15:26 ` Ian Campbell
2012-04-24 13:18   ` Ian Jackson
2012-04-24 13:17 ` Ian Jackson
2012-04-24 13:30   ` Ian Campbell
2012-04-24 13:34     ` Ian Jackson
2012-04-24 14:40       ` Ian Campbell
2012-04-24 14:47         ` Ian Jackson
2012-04-24 14:59           ` Ian Campbell
2012-04-24 17:58             ` Roger Pau Monne
2012-04-24 18:00               ` Ian Jackson
2012-04-24 17:07       ` Roger Pau Monne [this message]
2012-04-24 17:10         ` Ian Jackson

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=4F96DDE0.3020708@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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.