diff options
author | Garrett D'Amore <[email protected]> | 2012-06-06 10:01:43 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2012-08-23 10:40:14 -0700 |
commit | 08b1b21d58b1ae8a67fec38ccda02489c4aa8115 (patch) | |
tree | 6a9050af057485ce5306c609da68264af58876b6 /lib/libzfs | |
parent | e956d6510699b0c1aa757b1fb0c1ee9feb7419f7 (diff) |
Illumos #2803: zfs get guid pretty-prints the output
Reviewed by: Eric Schrock <[email protected]>
Reviewed by: Richard Elling <[email protected]>
Reviewed by: Alexander Eremin <[email protected]>
Approved by: Dan McDonald <[email protected]>
References:
https://www.illumos.org/issues/2803
Ported by: Martin Matuska <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'lib/libzfs')
-rw-r--r-- | lib/libzfs/libzfs_dataset.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index 8c463cd68..7ccd941c6 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek <[email protected]>. */ @@ -2313,6 +2314,17 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen, } break; + case ZFS_PROP_GUID: + /* + * GUIDs are stored as numbers, but they are identifiers. + * We don't want them to be pretty printed, because pretty + * printing mangles the ID into a truncated and useless value. + */ + if (get_numeric_property(zhp, prop, src, &source, &val) != 0) + return (-1); + (void) snprintf(propbuf, proplen, "%llu", (u_longlong_t)val); + break; + default: switch (zfs_prop_get_type(prop)) { case PROP_TYPE_NUMBER: |