X-Git-Url: http://git.datanom.net/omvzfs.git/blobdiff_plain/6e6b3eb901069df5b343b49638c73b050f46b57e..ddcd45581e5728b126260ed27c6f52a43b2699e6:/src/Zvol.php diff --git a/src/Zvol.php b/src/Zvol.php index 9ace6cf..9be6f5e 100644 --- a/src/Zvol.php +++ b/src/Zvol.php @@ -160,7 +160,7 @@ class OMVModuleZFSZvol { */ public function create($size, array $properties = null, $sparse = null) { $cmd = "zfs create -p "; - if (isset($sparse) && $sparse == true) { + if ((isset($sparse)) && ($sparse == true)) { $cmd .= "-s "; } $cmd .= "-V " . $size . " " . $this->name . " 2>&1"; @@ -181,6 +181,19 @@ class OMVModuleZFSZvol { $this->exec($cmd,$out,$res); } + /** + * Renames a Zvol + * + * @param string $newname New name of the Dataset + * @return void + * @access public + */ + public function rename($newname) { + $cmd = "zfs rename -p " . $this->name . " " . $newname . " 2>&1"; + $this->exec($cmd,$out,$res); + $this->name = $newname; + } + /** * Clears a previously set proporty and specifies that it should be * inherited from it's parent.