Changeset View
Changeset View
Standalone View
Standalone View
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
Show First 20 Lines • Show All 4,120 Lines • ▼ Show 20 Lines | zvol_check_dump_config(char *arg) | ||||
ret = 0; | ret = 0; | ||||
out: | out: | ||||
if (zhp) | if (zhp) | ||||
zpool_close(zhp); | zpool_close(zhp); | ||||
libzfs_fini(hdl); | libzfs_fini(hdl); | ||||
return (ret); | return (ret); | ||||
} | } | ||||
int | |||||
zpool_nextboot(libzfs_handle_t *hdl, uint64_t pool_guid, uint64_t dev_guid, | |||||
const char *command) | |||||
{ | |||||
zfs_cmd_t zc = { 0 }; | |||||
nvlist_t *args; | |||||
char *packed; | |||||
size_t size; | |||||
int error; | |||||
args = fnvlist_alloc(); | |||||
fnvlist_add_uint64(args, ZPOOL_CONFIG_POOL_GUID, pool_guid); | |||||
fnvlist_add_uint64(args, ZPOOL_CONFIG_GUID, dev_guid); | |||||
fnvlist_add_string(args, "command", command); | |||||
error = zcmd_write_src_nvlist(hdl, &zc, args); | |||||
if (error == 0) | |||||
error = ioctl(hdl->libzfs_fd, ZFS_IOC_NEXTBOOT, &zc); | |||||
zcmd_free_nvlists(&zc); | |||||
nvlist_free(args); | |||||
return (error); | |||||
} |