summaryrefslogtreecommitdiff
path: root/usr/src/lib/brand
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/brand')
-rw-r--r--usr/src/lib/brand/joyent/zone/statechange.ksh3
-rwxr-xr-xusr/src/lib/brand/kvm/zone/kinstall.ksh8
-rwxr-xr-xusr/src/lib/brand/kvm/zone/statechange.ksh3
3 files changed, 10 insertions, 4 deletions
diff --git a/usr/src/lib/brand/joyent/zone/statechange.ksh b/usr/src/lib/brand/joyent/zone/statechange.ksh
index 70be7819b4..97b041528a 100644
--- a/usr/src/lib/brand/joyent/zone/statechange.ksh
+++ b/usr/src/lib/brand/joyent/zone/statechange.ksh
@@ -248,7 +248,6 @@ setup_net()
fi
if [[ $allow_ip_spoof != "1" ]]; then
spoof_opts="${spoof_opts}${comma}ip-nospoof"
- ip_spoof_enabled="true"
comma=","
fi
if [[ $allow_restricted_traffic != "1" ]]; then
@@ -288,7 +287,7 @@ setup_net()
fi
fi
- if [[ -n "${zone_ip}" ]] && [[ -n "${ip_spoof_enabled}" ]] && \
+ if [[ -n "${zone_ip}" ]] && [[ $allow_ip_spoof != "1" ]] && \
[[ "${zone_ip}" != "dhcp" ]]; then
dladm set-linkprop -t -z $ZONENAME \
-p "allowed-ips=${zone_ip}" ${nic}
diff --git a/usr/src/lib/brand/kvm/zone/kinstall.ksh b/usr/src/lib/brand/kvm/zone/kinstall.ksh
index abd60a17b7..43b0c953d1 100755
--- a/usr/src/lib/brand/kvm/zone/kinstall.ksh
+++ b/usr/src/lib/brand/kvm/zone/kinstall.ksh
@@ -66,6 +66,14 @@ PDS_NAME=`mount | nawk -v p=$dname '{if ($1 == p) print $3}'`
[ -z "$PDS_NAME" ] && \
print -u2 "Brand error: missing parent ZFS dataset for $dname"
+# it's possible to specify a zone root here if you specified the
+# '-x nodataset' when installing the zone.
+if [[ -n ${TMPLZONE} ]]; then
+ zfs snapshot $PDS_NAME/${TMPLZONE}@${bname}
+ zfs clone -o quota=${ZQUOTA}g $PDS_NAME/${TMPLZONE}@${bname} \
+ $PDS_NAME/$bname
+fi
+
if [ ! -d ${ZONEPATH}/config ]; then
mkdir -p ${ZONEPATH}/config
chmod 755 ${ZONEPATH}/config
diff --git a/usr/src/lib/brand/kvm/zone/statechange.ksh b/usr/src/lib/brand/kvm/zone/statechange.ksh
index 22f647775a..efb10be50e 100755
--- a/usr/src/lib/brand/kvm/zone/statechange.ksh
+++ b/usr/src/lib/brand/kvm/zone/statechange.ksh
@@ -221,7 +221,6 @@ setup_net()
fi
if [[ $allow_ip_spoof != "1" ]]; then
spoof_opts="${spoof_opts}${comma}ip-nospoof"
- ip_spoof_enabled="true"
comma=","
fi
if [[ $allow_restricted_traffic != "1" ]]; then
@@ -244,7 +243,7 @@ setup_net()
fi
fi
- if [[ -n "${zone_ip}" ]] && [[ -n "${ip_spoof_enabled}" ]] && \
+ if [[ -n "${zone_ip}" ]] && [[ $allow_ip_spoof != "1" ]] && \
[[ "${zone_ip}" != "dhcp" ]]; then
dladm set-linkprop -t -z $ZONENAME \
-p "allowed-ips=${zone_ip}" ${nic}