]> git.datanom.net - omvzfs.git/blobdiff - gui/rpc/zfs.inc
Add option to set mountpoint when creating pool.
[omvzfs.git] / gui / rpc / zfs.inc
index b110ebe24e6c5266f81bda4fb0585d3e5e3f8c77..16b5a133183afa56dc2a56a2ac8256a6be0d5bdb 100644 (file)
@@ -11,6 +11,7 @@ require_once("zfs/Dataset.php");
 require_once("zfs/Snapshot.php");
 require_once("zfs/Zvol.php");
 require_once("zfs/Zpool.php");
+require_once("zfs/NotifyListener.php");
 
 class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
        public function getName() {
@@ -53,9 +54,18 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
                        throw new OMVModuleZFSException("Incorrect pool type specified");
                        break;
                }
+               //Check for user supplied options
+               $opts = "";
+               if ($params['force']) {
+                       $opts .= "-f ";
+               }
+               if (strlen($params['mountpoint']) > 0) {
+                       $opts .= "-m " . $params['mountpoint'] . " ";
+               }
+
                $disks = preg_split("/[,;]/", $params['devices']);
                $vdev = new OMVModuleZFSVdev($params['name'], $pooltype, $disks);
-               $pool = new OMVModuleZFSZpool($vdev);
+               $pool = new OMVModuleZFSZpool($vdev, $opts);
                //Ugly fix to solve the problem of blkid not displaying info on newly created pools
                $pool->export();
                $pool->import($pool->getName());
This page took 0.032486 seconds and 5 git commands to generate.