libzfs_status.c (236884) | libzfs_status.c (238926) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 30 unchanged lines hidden (view full) --- 39 * is left up to the caller, depending on whether it is a live pool or an 40 * import. 41 */ 42 43#include <libzfs.h> 44#include <string.h> 45#include <unistd.h> 46#include "libzfs_impl.h" | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 30 unchanged lines hidden (view full) --- 39 * is left up to the caller, depending on whether it is a live pool or an 40 * import. 41 */ 42 43#include <libzfs.h> 44#include <string.h> 45#include <unistd.h> 46#include "libzfs_impl.h" |
47#include "zfeature_common.h" |
|
47 48/* 49 * Message ID table. This must be kept in sync with the ZPOOL_STATUS_* defines 50 * in libzfs.h. Note that there are some status results which go past the end 51 * of this table, and hence have no associated message ID. 52 */ 53static char *zfs_msgid_table[] = { 54 "ZFS-8000-14", --- 259 unchanged lines hidden (view full) --- 314 return (ZPOOL_STATUS_REMOVED_DEV); 315 316 /* 317 * Outdated, but usable, version 318 */ 319 if (SPA_VERSION_IS_SUPPORTED(version) && version != SPA_VERSION) 320 return (ZPOOL_STATUS_VERSION_OLDER); 321 | 48 49/* 50 * Message ID table. This must be kept in sync with the ZPOOL_STATUS_* defines 51 * in libzfs.h. Note that there are some status results which go past the end 52 * of this table, and hence have no associated message ID. 53 */ 54static char *zfs_msgid_table[] = { 55 "ZFS-8000-14", --- 259 unchanged lines hidden (view full) --- 315 return (ZPOOL_STATUS_REMOVED_DEV); 316 317 /* 318 * Outdated, but usable, version 319 */ 320 if (SPA_VERSION_IS_SUPPORTED(version) && version != SPA_VERSION) 321 return (ZPOOL_STATUS_VERSION_OLDER); 322 |
323 /* 324 * Usable pool with disabled features 325 */ 326 if (version >= SPA_VERSION_FEATURES) { 327 int i; 328 nvlist_t *feat; 329 330 if (isimport) { 331 feat = fnvlist_lookup_nvlist(config, 332 ZPOOL_CONFIG_LOAD_INFO); 333 feat = fnvlist_lookup_nvlist(feat, 334 ZPOOL_CONFIG_ENABLED_FEAT); 335 } else { 336 feat = fnvlist_lookup_nvlist(config, 337 ZPOOL_CONFIG_FEATURE_STATS); 338 } 339 340 for (i = 0; i < SPA_FEATURES; i++) { 341 zfeature_info_t *fi = &spa_feature_table[i]; 342 if (!nvlist_exists(feat, fi->fi_guid)) 343 return (ZPOOL_STATUS_FEAT_DISABLED); 344 } 345 } 346 |
|
322 return (ZPOOL_STATUS_OK); 323} 324 325zpool_status_t 326zpool_get_status(zpool_handle_t *zhp, char **msgid) 327{ 328 zpool_status_t ret = check_status(zhp->zpool_config, B_FALSE); 329 --- 85 unchanged lines hidden --- | 347 return (ZPOOL_STATUS_OK); 348} 349 350zpool_status_t 351zpool_get_status(zpool_handle_t *zhp, char **msgid) 352{ 353 zpool_status_t ret = check_status(zhp->zpool_config, B_FALSE); 354 --- 85 unchanged lines hidden --- |