Skip to content

Commit

Permalink
Merge pull request pr1ntf#159 from moogle19/clone_fix
Browse files Browse the repository at this point in the history
Fix handling of '-r' option in 'clone' and removed '-c' option
  • Loading branch information
trent-pr1ntf committed May 6, 2016
2 parents 6a9778c + 1a85b7b commit 23f7bbd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ resize <name> <diskN> <size>
disks <name>
snap <name>@<snap>
roll <name>@<snap>
clone [-c | -r] <name> <clonename>
clone [-r] <name> <clonename>
export <name>
snaplist
taplist
Expand Down
6 changes: 3 additions & 3 deletions iohyve.8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" Text automatically generated by txt2man
.TH iohyve 8 "28 April 2016" "" "FreeBSD System Manager's Manual"
.TH iohyve 8 "30 April 2016" "" "FreeBSD System Manager's Manual"
.SH NAME
\fBiohyve(8) \fP- bhyve manager/launcher v0.7.5 "Tennessee Cherry Moonshine Edition"
\fB
Expand Down Expand Up @@ -41,7 +41,7 @@
\fBiohyve\fP \fIdisks\fP <name>
\fBiohyve\fP \fIsnap\fP <name>@<\fIsnap\fP>
\fBiohyve\fP \fIroll\fP <name>@<\fIsnap\fP>
\fBiohyve\fP \fIclone\fP [\fB-c\fP | \fB-r\fP] <name> <clonename>
\fBiohyve\fP \fIclone\fP [\fB-r\fP] <name> <clonename>
\fBiohyve\fP \fIexport\fP <name>
\fBiohyve\fP \fIsnaplist\fP
\fBiohyve\fP \fItaplist\fP
Expand Down Expand Up @@ -368,7 +368,7 @@ Clone a guest. Note that this will \fIclone\fP all of the properties.
If you want to use the \fIclone\fP and the original guest at the
same time you will need to change the tap and nmdm properties
or use the \fB-r\fP option to have \fBiohyve\fP do this for you
Usage: '\fBiohyve\fP \fIclone\fP [\fB-c\fP | \fB-r\fP] <name> <clonename>' where <name>
Usage: '\fBiohyve\fP \fIclone\fP [\fB-r\fP] <name> <clonename>' where <name>
is the name of the guest and <clonename> is what you would
like to name the new \fIclone\fP.
.TP
Expand Down
4 changes: 2 additions & 2 deletions iohyve.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ iohyve resize <name> <diskN> <size>
iohyve disks <name>
iohyve snap <name>@<snap>
iohyve roll <name>@<snap>
iohyve clone [-c | -r] <name> <clonename>
iohyve clone [-r] <name> <clonename>
iohyve export <name>
iohyve snaplist
iohyve taplist
Expand Down Expand Up @@ -282,7 +282,7 @@ clone Clone a guest. Note that this will clone all of the properties.
If you want to use the clone and the original guest at the
same time you will need to change the tap and nmdm properties
or use the -r option to have iohyve do this for you
Usage: 'iohyve clone [-c | -r] <name> <clonename>' where <name>
Usage: 'iohyve clone [-r] <name> <clonename>' where <name>
is the name of the guest and <clonename> is what you would
like to name the new clone.

Expand Down
4 changes: 4 additions & 0 deletions lib/ioh-zfs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ __cloneguest() {
local flag="$2"
local name="$2"
local cname="$3"
if [ "$flag" == "-r" ]; then
name="$3"
cname="$4"
fi
local description="$(date | sed -e 's/ /_/g')"
local pool="$(zfs list -H -t volume | grep iohyve/$name | grep disk0 | cut -d '/' -f 1 | head -n1)"
# Check if guest exists
Expand Down

0 comments on commit 23f7bbd

Please sign in to comment.