There are times when it is desirable for zfs to not automatically
populate the spa namespace at module load time using the pools
in the /etc/zfs/zpool.cache file. The zfs_autoimport_disable
module option has been added to control this behavior.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #330
* userland pools when doing testing.
*/
char *spa_config_path = ZPOOL_CACHE;
* userland pools when doing testing.
*/
char *spa_config_path = ZPOOL_CACHE;
+int zfs_autoimport_disable = 0;
/*
* Called when the module is first loaded, this routine loads the configuration
/*
* Called when the module is first loaded, this routine loads the configuration
struct _buf *file;
uint64_t fsize;
struct _buf *file;
uint64_t fsize;
+ if (zfs_autoimport_disable)
+ return;
+
/*
* Open the configuration file.
*/
/*
* Open the configuration file.
*/
module_param(spa_config_path, charp, 0444);
MODULE_PARM_DESC(spa_config_path, "SPA config file (/etc/zfs/zpool.cache)");
module_param(spa_config_path, charp, 0444);
MODULE_PARM_DESC(spa_config_path, "SPA config file (/etc/zfs/zpool.cache)");
+
+module_param(zfs_autoimport_disable, int, 0644);
+MODULE_PARM_DESC(zfs_autoimport_disable, "Disable pool import at module load");
+