mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-04-06 17:49:11 +03:00
Illumos #2803: zfs get guid pretty-prints the output
Reviewed by: Eric Schrock <eric.schrock@delphix.com> Reviewed by: Richard Elling <richard.elling@gmail.com> Reviewed by: Alexander Eremin <alexander.eremin@nexenta.com> Approved by: Dan McDonald <danmcd@nexenta.com> References: https://www.illumos.org/issues/2803 Ported by: Martin Matuska <martin@matuska.org> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
parent
e956d65106
commit
08b1b21d58
@ -23,6 +23,7 @@
|
|||||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright (c) 2010 Nexenta Systems, Inc. All rights reserved.
|
* Copyright (c) 2010 Nexenta Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2012 by Delphix. 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 <pawel@dawidek.net>.
|
* Copyright (c) 2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -2313,6 +2314,17 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
|
|||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
switch (zfs_prop_get_type(prop)) {
|
switch (zfs_prop_get_type(prop)) {
|
||||||
case PROP_TYPE_NUMBER:
|
case PROP_TYPE_NUMBER:
|
||||||
|
Loading…
Reference in New Issue
Block a user