[lxc-devel] [PATCH] lxc-create: zfs: consistently use zfsroot, not zfs_root
Stéphane Graber
stgraber at ubuntu.com
Fri May 17 16:27:23 UTC 2013
On 05/17/2013 12:26 PM, Serge Hallyn wrote:
> (I've applied this to staging, as without it lxc-create -B zfs failed
> if using a custom zfsroot)
>
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Makes sense.
Acked-by: Stéphane Graber <stgraber at ubuntu.com>
> ---
> src/lxc/lxc-create.in | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc-create.in
> index d854501..439ce51 100644
> --- a/src/lxc/lxc-create.in
> +++ b/src/lxc/lxc-create.in
> @@ -32,7 +32,7 @@ verify_btrfs() {
> }
>
> verify_zfs() {
> - if which zfs >/dev/null 2>&1 && zfs get all "$zfs_root" >/dev/null 2>&1; then
> + if which zfs >/dev/null 2>&1 && zfs get all "$zfsroot" >/dev/null 2>&1; then
> echo zfs
> else
> echo no
> @@ -198,7 +198,7 @@ while [ $# -gt 0 ]; do
> ;;
> --zfsroot)
> optarg_check $opt "$1"
> - zfs_root=$1
> + zfsroot=$1
> shift
> ;;
> --)
> @@ -248,8 +248,8 @@ if [ -z "$lvname" ]; then
> lvname="$lxc_name"
> fi
>
> -if [ -z "$zfs_root" ]; then
> - zfs_root="tank/lxc"
> +if [ -z "$zfsroot" ]; then
> + zfsroot="tank/lxc"
> fi
>
> if [ "$(id -u)" != "0" ]; then
> @@ -271,7 +271,7 @@ case "$backingstore" in
> ;;
> zfs)
> if [ `verify_zfs` != 'zfs' ]; then
> - echo "missing 'zfs' command or $zfs_root is not zfs" >&2
> + echo "missing 'zfs' command or $zfsroot is not zfs" >&2
> exit 1
> fi
> ;;
> @@ -313,7 +313,7 @@ cleanup() {
> elif [ "$backingstore" = "btrfs" ]; then
> btrfs subvolume delete "$rootfs" || true
> elif [ "$backingstore" = "zfs" ]; then
> - zfs destroy "$zfs_root/$lxc_name" || true
> + zfs destroy "$zfsroot/$lxc_name" || true
> fi
>
> ${bindir}/lxc-destroy -n $lxc_name -P "$lxc_path"
> @@ -325,7 +325,7 @@ trap cleanup HUP INT TERM
>
> # set up container dir per backing store
> if [ "$backingstore" = "zfs" ]; then
> - zfs create -omountpoint=$lxc_path/$lxc_name/rootfs "$zfs_root/$lxc_name"
> + zfs create -omountpoint=$lxc_path/$lxc_name/rootfs "$zfsroot/$lxc_name"
> elif [ "$backingstore" = "btrfs" ]; then
> mkdir "$lxc_path/$lxc_name"
> if ! out=$(btrfs subvolume create "$rootfs" 2>&1); then
>
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130517/3a3a0c57/attachment.pgp>
More information about the lxc-devel
mailing list