From: Ian Campbell Subject: Re: [PATCH v4 3/4] libxl: call hotplug scripts from libxl for vbd Date: Mon, 14 May 2012 13:51:53 +0100 Message-ID: <1336999913.31817.69.camel@zakaz.uk.xensource.com> References: <1336649312-11198-1-git-send-email-roger.pau@citrix.com> <1336649312-11198-4-git-send-email-roger.pau@citrix.com> <20395.60719.885071.452187@mariner.uk.xensource.com> <4FB0FCBE.1020802@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4FB0FCBE.1020802@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: Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Mon, 2012-05-14 at 13:38 +0100, Roger Pau Monne wrote: > >> +# Hack to prevent the execution of hotplug scripts from udev if the domain > >> +# has been launched from libxl > >> +if [ -n "${UDEV_CALL}" ]&& \ > >> + `xenstore-read "libxl/disable_udev">/dev/null 2>&1`; then > > > > This reads something from xenstore and executes it as a shell command! > > (Also it will go wrong if the value read is empty eg becaue the key > > doesn't exist.) > > Are you sure about this? This command never returns anything, because it > is redirected to /dev/null, so we only evaluate if it is able to read > libxl/disable_udev. If libxl/disable_udev exists this test is passed. You don't need the backticks for that though. With the backticks it will execute whatever happens to be in the key -- I guess it's something quite benign right now or you'd have seen errors. Ian.