mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
zfs label bootenv should store data as nvlist
nvlist does allow us to support different data types and systems. To encapsulate user data to/from nvlist, the libzfsbootenv library is provided. Reviewed-by: Arvind Sankar <nivedita@alum.mit.edu> Reviewed-by: Allan Jude <allan@klarasystems.com> Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Igor Kozhukhov <igor@dilos.org> Signed-off-by: Toomas Soome <tsoome@me.com> Closes #10774
This commit is contained in:
committed by
Brian Behlendorf
parent
c8bbb0c93d
commit
84d9492e52
@@ -4,6 +4,13 @@ pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/bin
|
||||
|
||||
pkgexec_PROGRAMS = libzfs_input_check
|
||||
|
||||
if BUILD_FREEBSD
|
||||
DEFAULT_INCLUDES += -I$(top_srcdir)/include/os/freebsd/zfs
|
||||
endif
|
||||
if BUILD_LINUX
|
||||
DEFAULT_INCLUDES += -I$(top_srcdir)/include/os/linux/zfs
|
||||
endif
|
||||
|
||||
libzfs_input_check_SOURCES = libzfs_input_check.c
|
||||
libzfs_input_check_LDADD = \
|
||||
$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
|
||||
|
||||
@@ -25,7 +25,9 @@
|
||||
#include <libzutil.h>
|
||||
|
||||
#include <sys/nvpair.h>
|
||||
#include <sys/vdev_impl.h>
|
||||
#include <sys/zfs_ioctl.h>
|
||||
#include <sys/zfs_bootenv.h>
|
||||
|
||||
/*
|
||||
* Test the nvpair inputs for the non-legacy zfs ioctl commands.
|
||||
@@ -762,9 +764,10 @@ test_set_bootenv(const char *pool)
|
||||
{
|
||||
nvlist_t *required = fnvlist_alloc();
|
||||
|
||||
fnvlist_add_string(required, "envmap", "test");
|
||||
fnvlist_add_uint64(required, "version", VB_RAW);
|
||||
fnvlist_add_string(required, GRUB_ENVMAP, "test");
|
||||
|
||||
IOC_INPUT_TEST(ZFS_IOC_SET_BOOTENV, pool, required, NULL, 0);
|
||||
IOC_INPUT_TEST_WILD(ZFS_IOC_SET_BOOTENV, pool, required, NULL, 0);
|
||||
|
||||
nvlist_free(required);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user