Lines Matching defs:nvl
198 spa_history_log_notify(spa_t *spa, nvlist_t *nvl)
204 if (nvlist_lookup_string(nvl, ZPOOL_HIST_CMD, &string) == 0)
207 if (nvlist_lookup_string(nvl, ZPOOL_HIST_INT_NAME, &string) == 0)
210 if (nvlist_lookup_string(nvl, ZPOOL_HIST_ZONE, &string) == 0)
213 if (nvlist_lookup_string(nvl, ZPOOL_HIST_HOST, &string) == 0)
216 if (nvlist_lookup_string(nvl, ZPOOL_HIST_DSNAME, &string) == 0)
219 if (nvlist_lookup_string(nvl, ZPOOL_HIST_INT_STR, &string) == 0)
222 if (nvlist_lookup_string(nvl, ZPOOL_HIST_IOCTL, &string) == 0)
225 if (nvlist_lookup_string(nvl, ZPOOL_HIST_INT_NAME, &string) == 0)
228 if (nvlist_lookup_uint64(nvl, ZPOOL_HIST_DSID, &uint64) == 0)
231 if (nvlist_lookup_uint64(nvl, ZPOOL_HIST_TXG, &uint64) == 0)
234 if (nvlist_lookup_uint64(nvl, ZPOOL_HIST_TIME, &uint64) == 0)
237 if (nvlist_lookup_uint64(nvl, ZPOOL_HIST_WHO, &uint64) == 0)
240 if (nvlist_lookup_uint64(nvl, ZPOOL_HIST_INT_EVENT, &uint64) == 0)
254 nvlist_t *nvl = arg;
290 fnvlist_add_string(nvl, ZPOOL_HIST_HOST, utsname()->nodename);
292 if (nvlist_exists(nvl, ZPOOL_HIST_CMD)) {
294 fnvlist_lookup_string(nvl, ZPOOL_HIST_CMD));
295 } else if (nvlist_exists(nvl, ZPOOL_HIST_INT_NAME)) {
296 if (nvlist_exists(nvl, ZPOOL_HIST_DSNAME)) {
298 (longlong_t)fnvlist_lookup_uint64(nvl,
300 fnvlist_lookup_string(nvl, ZPOOL_HIST_INT_NAME),
301 fnvlist_lookup_string(nvl, ZPOOL_HIST_DSNAME),
302 (u_longlong_t)fnvlist_lookup_uint64(nvl,
304 fnvlist_lookup_string(nvl, ZPOOL_HIST_INT_STR));
307 (longlong_t)fnvlist_lookup_uint64(nvl,
309 fnvlist_lookup_string(nvl, ZPOOL_HIST_INT_NAME),
310 fnvlist_lookup_string(nvl, ZPOOL_HIST_INT_STR));
327 spa_history_log_notify(spa, nvl);
328 } else if (nvlist_exists(nvl, ZPOOL_HIST_IOCTL)) {
330 fnvlist_lookup_string(nvl, ZPOOL_HIST_IOCTL));
333 VERIFY3U(nvlist_pack(nvl, &record_packed, &reclen, NV_ENCODE_NATIVE,
346 nvlist_exists(nvl, ZPOOL_HIST_CMD)) {
353 fnvlist_free(nvl);
363 nvlist_t *nvl = fnvlist_alloc();
365 fnvlist_add_string(nvl, ZPOOL_HIST_CMD, msg);
366 err = spa_history_log_nvl(spa, nvl);
367 fnvlist_free(nvl);
372 spa_history_log_nvl(spa_t *spa, nvlist_t *nvl)
381 err = nvlist_lookup_nvlist(nvl, ZPOOL_HIST_INPUT_NVL, &in_nvl);
396 VERIFY0(nvlist_dup(nvl, &nvarg, KM_SLEEP));
413 /* spa_history_log_sync will free nvl */
518 log_internal(nvlist_t *nvl, const char *operation, spa_t *spa,
529 fnvlist_free(nvl);
537 fnvlist_add_string(nvl, ZPOOL_HIST_INT_STR, msg);
540 fnvlist_add_string(nvl, ZPOOL_HIST_INT_NAME, operation);
541 fnvlist_add_uint64(nvl, ZPOOL_HIST_TXG, tx->tx_txg);
542 fnvlist_add_uint64(nvl, ZPOOL_HIST_TIME, gethrestime_sec());
545 spa_history_log_sync(nvl, tx);
548 spa_history_log_sync, nvl, tx);
550 /* spa_history_log_sync() will free nvl */
584 nvlist_t *nvl = fnvlist_alloc();
589 fnvlist_add_string(nvl, ZPOOL_HIST_DSNAME, namebuf);
590 fnvlist_add_uint64(nvl, ZPOOL_HIST_DSID, ds->ds_object);
593 log_internal(nvl, operation, dsl_dataset_get_spa(ds), tx, fmt, adx);
603 nvlist_t *nvl = fnvlist_alloc();
608 fnvlist_add_string(nvl, ZPOOL_HIST_DSNAME, namebuf);
609 fnvlist_add_uint64(nvl, ZPOOL_HIST_DSID,
613 log_internal(nvl, operation, dd->dd_pool->dp_spa, tx, fmt, adx);