From: Ryan Grimm <grimm@us.ibm.com>
To: Xen Devel <xen-devel@lists.xensource.com>
Cc: Dan Smith <danms@us.ibm.com>
Subject: [PATCH 6 of 6] dm-userspace backend script and xmexample change
Date: Fri, 25 Aug 2006 16:24:14 -0500 [thread overview]
Message-ID: <20060825212414.GG31071@localhost.localdomain> (raw)
In-Reply-To: <patchbomb.1156540578@venkman-64>
Signed-off-by: Ryan Grimm <grimm@us.ibm.com>
Signed-off-by: Dan Smith <danms@us.ibm.com>
# HG changeset patch
# User Ryan Grimm <grimm@us.ibm.com>
# Date 1156536098 18000
# Node ID 55e3795e5bc46ea6a205e60ebf27ed9faf306616
# Parent be4574d288030b64d4623dd33505d0990185a6b9
dm-userspace backend script and xmexample change
diff -r be4574d28803 -r 55e3795e5bc4 tools/examples/Makefile
--- a/tools/examples/Makefile Fri Aug 25 15:01:36 2006 -0500
+++ b/tools/examples/Makefile Fri Aug 25 15:01:38 2006 -0500
@@ -32,6 +32,7 @@ XEN_SCRIPTS += vtpm vtpm-delete
XEN_SCRIPTS += vtpm vtpm-delete
XEN_SCRIPTS += xen-hotplug-cleanup
XEN_SCRIPTS += external-device-migrate
+XEN_SCRIPTS += block-dmu
XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
diff -r be4574d28803 -r 55e3795e5bc4 tools/examples/README
--- a/tools/examples/README Fri Aug 25 15:01:36 2006 -0500
+++ b/tools/examples/README Fri Aug 25 15:01:38 2006 -0500
@@ -13,6 +13,7 @@ block-common.sh - sourced by block,
block-common.sh - sourced by block, block-*
block-enbd - binds/unbinds network block devices
block-nbd - binds/unbinds network block devices
+block-dmu - binds/unbinds dm-userspace devices
external-device-migrate - called by xend for migrating external devices
locking.sh - locking functions to prevent concurrent access to
critical sections inside script files
diff -r be4574d28803 -r 55e3795e5bc4 tools/examples/xmexample1
--- a/tools/examples/xmexample1 Fri Aug 25 15:01:36 2006 -0500
+++ b/tools/examples/xmexample1 Fri Aug 25 15:01:38 2006 -0500
@@ -64,6 +64,13 @@ vif = [ '' ]
# and MODE is r for read-only, w for read-write.
disk = [ 'phy:hda1,hda1,w' ]
+
+#----------------------------------------------------------------------------
+# Using a dm-userspace backed device
+# for dmu, the syntax is dmu:<plugin>:<cow file>:<base file>
+# if <cow file> does not exist, it is created and <base file> is used
+# as a base. if <cow file> does exist, <base file> is ignored.
+# disk = [ 'dmu:dscow:/path/to/domain.dscow:/path/to/domain.img,hda1,w']
#----------------------------------------------------------------------------
# Define to which TPM instance the user domain should communicate.
diff -r be4574d28803 -r 55e3795e5bc4 tools/examples/block-dmu
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/examples/block-dmu Fri Aug 25 15:01:38 2006 -0500
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# Copyright (C) International Business Machines Corp., 2006
+# Author: Ryan Grimm <grimm@us.ibm.com>
+
+dir=$(dirname "$0")
+. "$dir/block-common.sh"
+
+p=$(xenstore_read "$XENBUS_PATH/params")
+mode=$(xenstore_read "$XENBUS_PATH/mode")
+
+wait_for_cowd_exit() {
+ while ps ax | grep -v grep | grep cowd | grep -q $1; do
+ sleep 1
+ done
+}
+
+case "$command" in
+ add)
+ plugin=$(echo $p | cut -d: -f1)
+ dmu_file=$(echo $p | cut -d: -f2)
+ base_file=$(echo $p | cut -d: -f3)
+
+ domain_name=$(xenstore_read "$XENBUS_PATH/domain")
+ domain_dev=$(xenstore_read "$XENBUS_PATH/dev")
+ target="$domain_name""_""$domain_dev"
+ md_dev="/dev/mapper/$target"
+
+ lsmod | grep -q dm_user || modprobe dm-user || fatal \
+ 'cannot load module dm-user'
+
+ wait_for_cowd_exit $target
+
+ if [ ! -e $dmu_file ]
+ then
+ dscow_tool -c $dmu_file $base_file || fatal \
+ 'creation of $dmu_file failed'
+ fi
+
+ cowd --sync --pidfile=/var/run/cowd.$target.pid -p $plugin \
+ $target $dmu_file || fatal 'cowd failed'
+
+ xenstore_write "$XENBUS_PATH/node" "$target"
+
+ claim_lock "block"
+ write_dev $md_dev
+ release_lock "block"
+ exit 0
+ ;;
+
+ remove)
+ node=$(xenstore_read "$XENBUS_PATH/node")
+ cowd_pid=$(cat "/var/run/cowd.$node.pid")
+ kill $cowd_pid
+ exit 0
+ ;;
+esac
prev parent reply other threads:[~2006-08-25 21:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <patchbomb.1156540578@venkman-64>
2006-08-25 21:23 ` [PATCH 1 of 6] dm-userspace xen kernel patch Ryan Grimm
2006-08-25 21:23 ` [PATCH 2 of 6] dm-userspace userspace tool base patch Ryan Grimm
2006-08-25 21:24 ` [PATCH 3 of 6] dm-userspace internal libdmu support for userspace tool Ryan Grimm
2006-08-25 21:24 ` [PATCH 4 of 6] dscow plugin for dm-userspace " Ryan Grimm
2006-08-25 21:24 ` [PATCH 5 of 6] qcow " Ryan Grimm
2006-08-25 21:24 ` Ryan Grimm [this message]
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=20060825212414.GG31071@localhost.localdomain \
--to=grimm@us.ibm.com \
--cc=danms@us.ibm.com \
--cc=xen-devel@lists.xensource.com \
/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.