From patchwork Thu Feb 25 19:25:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 8426111 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D4F4CC0554 for ; Thu, 25 Feb 2016 19:28:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1129A2039C for ; Thu, 25 Feb 2016 19:28:24 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1FB9C203A0 for ; Thu, 25 Feb 2016 19:28:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aZ1Xc-00052h-6o; Thu, 25 Feb 2016 19:25:36 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aZ1Xa-00051g-K2 for xen-devel@lists.xenproject.org; Thu, 25 Feb 2016 19:25:34 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id E0/8F-03306-D255FC65; Thu, 25 Feb 2016 19:25:33 +0000 X-Env-Sender: prvs=856d7c560=roger.pau@citrix.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1456428326!25110105!3 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 39840 invoked from network); 25 Feb 2016 19:25:32 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-14.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 25 Feb 2016 19:25:32 -0000 X-IronPort-AV: E=Sophos;i="5.22,498,1449532800"; d="scan'208";a="334580423" From: Roger Pau Monne To: Date: Thu, 25 Feb 2016 20:25:14 +0100 Message-ID: <1456428318-8318-4-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 2.5.4 (Apple Git-61) In-Reply-To: <1456428318-8318-1-git-send-email-roger.pau@citrix.com> References: <1456428318-8318-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Wei Liu , Ian Jackson , Ian Campbell , Roger Pau Monne Subject: [Xen-devel] [PATCH v2 3/7] hotplug/FreeBSD: add block hotplug script X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is the default hotplug script for block devices. Its only job is to copy the "params" blkback xenstore node to "physical-device". Signed-off-by: Roger Pau Monné Acked-by: Wei Liu --- Cc: Ian Jackson Cc: Ian Campbell Cc: Wei Liu --- 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 10fce4f..bd7a86f 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..1f2a533 --- /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/physical-device $params + exit 0 + ;; +*) + exit 0 + ;; +esac