From f0f3ef5a19910089bada873cb30b3f5d88cb9e00 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 6 Jun 2012 10:01:43 -0700 Subject: 2803 zfs get guid pretty-prints the output Reviewed by: Eric Schrock Reviewed by: Richard Elling Reviewed by: Alexander Eremin Approved by: Dan McDonald --- usr/src/lib/libzfs/common/libzfs_dataset.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'usr/src/lib/libzfs/common/libzfs_dataset.c') diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c index 43d71a465e..c1767cb910 100644 --- a/usr/src/lib/libzfs/common/libzfs_dataset.c +++ b/usr/src/lib/libzfs/common/libzfs_dataset.c @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 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. */ #include @@ -2280,6 +2281,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: -- cgit v1.2.3