]> git.datanom.net - omvzfs.git/blobdiff - src/Zvol.php
Minor change to snapshots in Dataset and Zvol classes.
[omvzfs.git] / src / Zvol.php
index f2d3cd27acb212386d003dad0df9dc196c66d188..603188aa6c49af16888294b847b8d137ba103948 100644 (file)
@@ -68,14 +68,12 @@ class OMVModuleZFSZvol {
                                continue;
                        }
                }
-               $qname = preg_quote($name . "@", '/');
-               $cmd = "zfs list -H -t snapshot 2>&1";
-               $this->exec($cmd, $out, $res);
-               foreach ($out as $line) {
-                       if (preg_match('/^(' . $qname . '[^\s]+)\t.*$/', $line, $res)) {
-                               $this->snapshots[$res[1]] = new OMVModuleZFSSnapshot($res[1]);
-                       }
+               $cmd = "zfs list -r -o name -H -t snapshot " . $name . " 2>&1";
+               $this->exec($cmd, $out2, $res2);
+               foreach ($out2 as $line2) {
+                       $this->snapshots[$line2] = new OMVModuleZFSSnapshot($line2);
                }
+
        }
 
        /**
This page took 0.031926 seconds and 5 git commands to generate.