From: Ian Campbell Subject: Re: [PATCH] libxl: prevent xl from running if xend is running. Date: Mon, 23 Apr 2012 16:26:23 +0100 Message-ID: <1335194783.4347.34.camel@zakaz.uk.xensource.com> References: <1335193862-37069-1-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1335193862-37069-1-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: George Dunlap , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Mon, 2012-04-23 at 16:11 +0100, Roger Pau Monne wrote: > @@ -112,6 +116,9 @@ int main(int argc, char **argv) > case 'N': > dryrun_only = 1; > break; > + case 'f': > + force_execution = 1; > + break; > default: > fprintf(stderr, "unknown global option\n"); > exit(2); Needs a matching docs patch to add the option to the manpage. Otherwise: Acked-by: Ian Campbell > @@ -126,6 +133,15 @@ int main(int argc, char **argv) > } > opterr = 0; > > + for (int i = 0; i < sizeof(locks)/sizeof(locks[0]); i++) { > + 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"); You might as well wrap the output text to 80 columns (I didn't count, I assume this isn't...) > + exit(2); > + } > + } > +