xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xen.org
Cc: Christoph Egger <Christoph.Egger@amd.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v2 3/5] hotplug/NetBSD: check type of file to attach from params
Date: Thu, 26 Jul 2012 20:54:34 +0100	[thread overview]
Message-ID: <1343332476-33765-4-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1343332476-33765-1-git-send-email-roger.pau@citrix.com>

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.

Changes since v1:

 * Check that file is either a block special file or a regular file
   and report error otherwise.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/hotplug/NetBSD/block |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tools/hotplug/NetBSD/block b/tools/hotplug/NetBSD/block
index cf5ff3a..31d9998 100644
--- a/tools/hotplug/NetBSD/block
+++ b/tools/hotplug/NetBSD/block
@@ -19,8 +19,14 @@ error() {
 
 xpath=$1
 xstatus=$2
-xtype=$(xenstore-read "$xpath/type")
 xparams=$(xenstore-read "$xpath/params")
+if [ -b $xparams ]; then
+	xtype="phy"
+elif [ -f $xparams ]; then
+	xtype="file"
+else
+	error "invalid file type"
+fi
 
 case $xstatus in
 6)
-- 
1.7.7.5 (Apple Git-26)

  parent reply	other threads:[~2012-07-26 19:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-26 19:54 [PATCH v2 0/5] NetBSD: minor fixes and hotplug execution Roger Pau Monne
2012-07-26 19:54 ` [PATCH v2 1/5] tools/build: fix pygrub linking Roger Pau Monne
2012-07-27  8:48   ` Ian Campbell
2012-08-01 11:47     ` Ian Campbell
2012-08-02  5:42       ` Olaf Hering
2012-08-02  6:44         ` Ian Campbell
2012-07-26 19:54 ` [PATCH v2 2/5] libxl: react correctly to POLLHUP Roger Pau Monne
2012-07-27  8:53   ` Ian Campbell
2012-07-27 14:26   ` Ian Jackson
2012-07-27 17:01     ` Ian Jackson
2012-07-31 13:18       ` Ian Campbell
2012-07-31 14:42         ` Ian Jackson
2012-07-27 14:27   ` Ian Jackson
2012-07-26 19:54 ` Roger Pau Monne [this message]
2012-07-27 14:28   ` [PATCH v2 3/5] hotplug/NetBSD: check type of file to attach from params Ian Jackson
2012-07-26 19:54 ` [PATCH v2 4/5] libxl: call hotplug scripts from xl for NetBSD Roger Pau Monne
2012-07-27 12:49   ` Christoph Egger
2012-08-01 11:47     ` Ian Campbell
2012-07-26 19:54 ` [PATCH v2 5/5] init/NetBSD: move xenbackendd to xend init script Roger Pau Monne
2012-07-27 12:50   ` Christoph Egger
2012-07-27 14:29     ` Ian Jackson
2012-07-27 14:49       ` Christoph Egger
2012-08-01 11:47         ` Ian Campbell

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=1343332476-33765-4-git-send-email-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=Christoph.Egger@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).