From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: Re: [PATCH 7/9] hotplug/NetBSD: check type of file to attach from params Date: Wed, 11 Jul 2012 13:54:42 +0200 Message-ID: <4FFD6982.9040100@amd.com> References: <1342002232-75531-1-git-send-email-roger.pau@citrix.com> <1342002232-75531-8-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: <1342002232-75531-8-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: Ian Jackson , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 07/11/12 12:23, Roger Pau Monne wrote: > xend used to set the xenbus backend entry "type" to either "phy" or > "file", but now libxl sets it to "phy" for both file and block device. > We have to manually check for the type of the "param" filed in order > to detect if we are trying to attach a file or a block device. > > Cc: Ian Jackson > Cc: Christoph Egger > Signed-off-by: Roger Pau Monne Acked-by: Christoph Egger > --- > tools/hotplug/NetBSD/block | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/tools/hotplug/NetBSD/block b/tools/hotplug/NetBSD/block > index cf5ff3a..95acaa0 100644 > --- a/tools/hotplug/NetBSD/block > +++ b/tools/hotplug/NetBSD/block > @@ -19,8 +19,12 @@ error() { > > xpath=$1 > xstatus=$2 > -xtype=$(xenstore-read "$xpath/type") > xparams=$(xenstore-read "$xpath/params") > +if [ -b $xparams ]; then > + xtype="phy" > +else > + xtype="file" > +fi > > case $xstatus in > 6) -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85689 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632