Illumos #510: 'zfs get' enhancement - mountpoint as an argument
authorShampavman <sham.pavman@nexenta.com>
Tue, 26 Jul 2011 18:53:09 +0000 (11:53 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 1 Aug 2011 19:09:11 +0000 (12:09 -0700)
The 'zfs get' command should be able to deal with mountpoint
as an argument.  It already works with 'zfs list' command:

  # zfs list /export/home/estibi
  NAME                       USED  AVAIL  REFER  MOUNTPOINT
  rpool/export/home/estibi  1.14G  3.86G  1.14G  /export/home/estibi

but it fails with 'zfs get':

  # zfs get all /export/home/estibi
  cannot open '/export/home/estibi': invalid dataset name

Reviewed by: Eric Schrock <eric.schrock@delphix.com>
Reviewed by: Deano <deano@rattie.demon.co.uk>
Reviewed by: Garrett D'Amore <garrett@nexenta.com>
Approved by: Garrett D'Amore <garrett@nexenta.com>

References to Illumos issue and patch:
- https://www.illumos.org/issues/510
- https://github.com/illumos/illumos-gate/commit/5ead3ed965

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #340

cmd/zfs/zfs_main.c

index b6dc6d4..69a6736 100644 (file)
@@ -21,6 +21,7 @@
 
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
  */
 
 #include <assert.h>
@@ -1274,7 +1275,7 @@ static int
 zfs_do_get(int argc, char **argv)
 {
        zprop_get_cbdata_t cb = { 0 };
-       int i, c, flags = 0;
+       int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS;
        char *value, *fields;
        int ret;
        int limit = 0;