Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Oct 2012 19:27:55 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241284 - head/sys/boot/i386/loader
Message-ID:  <201210061927.q96JRt0w025313@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Sat Oct  6 19:27:54 2012
New Revision: 241284
URL: http://svn.freebsd.org/changeset/base/241284

Log:
  zfs boot: add lszfs command to i386 loader
  
  ... to list child datasets of a specified dataset.
  Dataset name should be provided in poolname/dsname format.
  
  MFC after:	17 days

Modified:
  head/sys/boot/i386/loader/main.c

Modified: head/sys/boot/i386/loader/main.c
==============================================================================
--- head/sys/boot/i386/loader/main.c	Sat Oct  6 19:27:04 2012	(r241283)
+++ head/sys/boot/i386/loader/main.c	Sat Oct  6 19:27:54 2012	(r241284)
@@ -322,6 +322,29 @@ command_heap(int argc, char *argv[])
     return(CMD_OK);
 }
 
+#ifdef LOADER_ZFS_SUPPORT
+COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset",
+    command_lszfs);
+
+static int
+command_lszfs(int argc, char *argv[])
+{
+    int err;
+
+    if (argc != 2) {
+	command_errmsg = "wrong number of arguments";
+	return (CMD_ERROR);
+    }
+
+    err = zfs_list(argv[1]);
+    if (err != 0) {
+	command_errmsg = strerror(err);
+	return (CMD_ERROR);
+    }
+    return (CMD_OK);
+}
+#endif
+
 /* ISA bus access functions for PnP. */
 static int
 isa_inb(int port)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210061927.q96JRt0w025313>