All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH RFC 4/5] hotplug/FreeBSD: add block hotplug script
Date: Fri, 22 May 2015 11:18:57 +0200	[thread overview]
Message-ID: <1432286338-56077-5-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1432286338-56077-1-git-send-email-roger.pau@citrix.com>

This is the default hotplug script for block devices. Its only job is to
copy the "params" blkback xenstore node to "path".

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
 tools/hotplug/FreeBSD/Makefile |  2 +-
 tools/hotplug/FreeBSD/block    | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 tools/hotplug/FreeBSD/block

diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
index 8dfc90a..52a95c8 100644
--- a/tools/hotplug/FreeBSD/Makefile
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -2,7 +2,7 @@ XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 # Xen script dir and scripts to go there.
-XEN_SCRIPTS = vif-bridge
+XEN_SCRIPTS = vif-bridge block
 
 XEN_SCRIPT_DATA =
 
diff --git a/tools/hotplug/FreeBSD/block b/tools/hotplug/FreeBSD/block
new file mode 100644
index 0000000..782e5c6
--- /dev/null
+++ b/tools/hotplug/FreeBSD/block
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+#
+# FreeBSD hotplug script for attaching disks
+#
+# Parameters:
+#	$1: xenstore backend path of the vbd
+#	$2: action, either "add" or "remove"
+#
+# Environment variables:
+#	None
+#
+
+path=$1
+action=$2
+params=$(xenstore-read "$path/params")
+
+case $action in
+add)
+	xenstore-write $path/path $params
+	exit 0
+	;;
+*)
+	exit 0
+	;;
+esac
-- 
1.9.5 (Apple Git-50.3)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2015-05-22  9:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22  9:18 [PATCH RFC 0/5] tools/FreeBSD: enable disk hotplug scripts Roger Pau Monne
2015-05-22  9:18 ` [PATCH RFC 1/5] libxl: only write physical-device on Linux and NetBSD Roger Pau Monne
2015-05-22  9:18 ` [PATCH RFC 2/5] blkif: document new blkback path xenstore node Roger Pau Monne
2015-06-01 13:24   ` Wei Liu
2015-06-02 15:22     ` Roger Pau Monné
2015-06-02 16:57       ` Wei Liu
2015-06-17 13:22     ` Ian Campbell
2015-05-22  9:18 ` [PATCH RFC 3/5] libxl/FreeBSD: write blkback "path" node Roger Pau Monne
2015-05-22  9:18 ` Roger Pau Monne [this message]
2015-05-22  9:18 ` [PATCH RFC 5/5] libxl/FreeBSD: add support for disk hotplug scripts Roger Pau Monne
2015-06-17 13:23   ` Ian Campbell
2015-06-17 14:57     ` Roger Pau Monné

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=1432286338-56077-5-git-send-email-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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.