Changeset View
Changeset View
Standalone View
Standalone View
cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
Show All 14 Lines | |||||
* If applicable, add the following below this CDDL HEADER, with the | * If applicable, add the following below this CDDL HEADER, with the | ||||
* fields enclosed by brackets "[]" replaced with your own identifying | * fields enclosed by brackets "[]" replaced with your own identifying | ||||
* information: Portions Copyright [yyyy] [name of copyright owner] | * information: Portions Copyright [yyyy] [name of copyright owner] | ||||
* | * | ||||
* CDDL HEADER END | * CDDL HEADER END | ||||
*/ | */ | ||||
/* | /* | ||||
* Copyright (c) 2012, 2018 by Delphix. All rights reserved. | * Copyright (c) 2012, 2020 by Delphix. All rights reserved. | ||||
* Copyright (c) 2013 Steven Hartland. All rights reserved. | * Copyright (c) 2013 Steven Hartland. All rights reserved. | ||||
* Copyright (c) 2014 Integros [integros.com] | * Copyright (c) 2014 Integros [integros.com] | ||||
* Copyright 2017 RackTop Systems. | * Copyright 2017 RackTop Systems. | ||||
* Copyright (c) 2017 Datto Inc. | * Copyright (c) 2017 Datto Inc. | ||||
*/ | */ | ||||
/* | /* | ||||
* LibZFS_Core (lzc) is intended to replace most functionality in libzfs. | * LibZFS_Core (lzc) is intended to replace most functionality in libzfs. | ||||
▲ Show 20 Lines • Show All 1,172 Lines • ▼ Show 20 Lines | lzc_initialize(const char *poolname, pool_initialize_func_t cmd_type, | ||||
fnvlist_add_uint64(args, ZPOOL_INITIALIZE_COMMAND, (uint64_t)cmd_type); | fnvlist_add_uint64(args, ZPOOL_INITIALIZE_COMMAND, (uint64_t)cmd_type); | ||||
fnvlist_add_nvlist(args, ZPOOL_INITIALIZE_VDEVS, vdevs); | fnvlist_add_nvlist(args, ZPOOL_INITIALIZE_VDEVS, vdevs); | ||||
error = lzc_ioctl(ZFS_IOC_POOL_INITIALIZE, poolname, args, errlist); | error = lzc_ioctl(ZFS_IOC_POOL_INITIALIZE, poolname, args, errlist); | ||||
fnvlist_free(args); | fnvlist_free(args); | ||||
return (error); | return (error); | ||||
} | |||||
/* | |||||
* Set the bootenv contents for the given pool. | |||||
*/ | |||||
int | |||||
lzc_set_bootenv(const char *pool, const nvlist_t *env) | |||||
{ | |||||
return (lzc_ioctl(ZFS_IOC_SET_BOOTENV, pool, (nvlist_t *)env, NULL)); | |||||
} | |||||
/* | |||||
* Get the contents of the bootenv of the given pool. | |||||
*/ | |||||
int | |||||
lzc_get_bootenv(const char *pool, nvlist_t **outnvl) | |||||
{ | |||||
return (lzc_ioctl(ZFS_IOC_GET_BOOTENV, pool, NULL, outnvl)); | |||||
} | } |