Blame libmultipath/config.h

Packit Service 0af388
#ifndef _CONFIG_H
Packit Service 0af388
#define _CONFIG_H
Packit Service 0af388
Packit Service 0af388
#include <sys/types.h>
Packit Service 0af388
#include <stdint.h>
Packit Service 0af388
#include <urcu.h>
Packit Service 0af388
#include <inttypes.h>
Packit Service 0af388
#include "byteorder.h"
Packit Service 0af388
Packit Service 0af388
#define ORIGIN_DEFAULT 0
Packit Service 0af388
#define ORIGIN_CONFIG  1
Packit Service d76d99
#define ORIGIN_NO_CONFIG 2
Packit Service 0af388
Packit Service 0af388
/*
Packit Service 0af388
 * In kernel, fast_io_fail == 0 means immediate failure on rport delete.
Packit Service 0af388
 * OTOH '0' means not-configured in various places in multipath-tools.
Packit Service 0af388
 */
Packit Service 0af388
#define MP_FAST_IO_FAIL_UNSET (0)
Packit Service 0af388
#define MP_FAST_IO_FAIL_OFF (-1)
Packit Service 0af388
#define MP_FAST_IO_FAIL_ZERO (-2)
Packit Service 0af388
Packit Service 0af388
enum devtypes {
Packit Service 0af388
	DEV_NONE,
Packit Service 0af388
	DEV_DEVT,
Packit Service 0af388
	DEV_DEVNODE,
Packit Service 0af388
	DEV_DEVMAP,
Packit Service 0af388
	DEV_UEVENT
Packit Service 0af388
};
Packit Service 0af388
Packit Service 0af388
enum mpath_cmds {
Packit Service 0af388
	CMD_NONE,
Packit Service 0af388
	CMD_CREATE,
Packit Service 0af388
	CMD_DRY_RUN,
Packit Service 0af388
	CMD_LIST_SHORT,
Packit Service 0af388
	CMD_LIST_LONG,
Packit Service 0af388
	CMD_VALID_PATH,
Packit Service 0af388
	CMD_REMOVE_WWID,
Packit Service 0af388
	CMD_RESET_WWIDS,
Packit Service 0af388
	CMD_ADD_WWID,
Packit Service 0af388
	CMD_USABLE_PATHS,
Packit Service 0af388
	CMD_DUMP_CONFIG,
Packit Service d796e1
	CMD_FLUSH_ONE,
Packit Service d796e1
	CMD_FLUSH_ALL,
Packit Service 0af388
};
Packit Service 0af388
Packit Service 0af388
enum force_reload_types {
Packit Service 0af388
	FORCE_RELOAD_NONE,
Packit Service 0af388
	FORCE_RELOAD_YES,
Packit Service 0af388
	FORCE_RELOAD_WEAK,
Packit Service 0af388
};
Packit Service 0af388
Packit Service 0af388
struct hwentry {
Packit Service 0af388
	char * vendor;
Packit Service 0af388
	char * product;
Packit Service 0af388
	char * revision;
Packit Service 0af388
	char * uid_attribute;
Packit Service 0af388
	char * getuid;
Packit Service 0af388
	char * features;
Packit Service 0af388
	char * hwhandler;
Packit Service 0af388
	char * selector;
Packit Service 0af388
	char * checker_name;
Packit Service 0af388
	char * prio_name;
Packit Service 0af388
	char * prio_args;
Packit Service 0af388
	char * alias_prefix;
Packit Service 0af388
Packit Service 0af388
	int pgpolicy;
Packit Service 0af388
	int pgfailback;
Packit Service 0af388
	int rr_weight;
Packit Service 0af388
	int no_path_retry;
Packit Service 0af388
	int minio;
Packit Service 0af388
	int minio_rq;
Packit Service 0af388
	int flush_on_last_del;
Packit Service 0af388
	int fast_io_fail;
Packit Service 0af388
	unsigned int dev_loss;
Packit Service 0af388
	int user_friendly_names;
Packit Service 0af388
	int retain_hwhandler;
Packit Service 0af388
	int detect_prio;
Packit Service 0af388
	int detect_checker;
Packit Service 0af388
	int deferred_remove;
Packit Service 0af388
	int delay_watch_checks;
Packit Service 0af388
	int delay_wait_checks;
Packit Service 0af388
	int san_path_err_threshold;
Packit Service 0af388
	int san_path_err_forget_rate;
Packit Service 0af388
	int san_path_err_recovery_time;
Packit Service 0af388
	int marginal_path_err_sample_time;
Packit Service 0af388
	int marginal_path_err_rate_threshold;
Packit Service 0af388
	int marginal_path_err_recheck_gap_time;
Packit Service 0af388
	int marginal_path_double_failed_time;
Packit Service 0af388
	int skip_kpartx;
Packit Service 0af388
	int max_sectors_kb;
Packit Service 0af388
	int ghost_delay;
Packit Service 0af388
	int all_tg_pt;
Packit Service 0af388
	int vpd_vendor_id;
Packit Service 0af388
	char * bl_product;
Packit Service 0af388
};
Packit Service 0af388
Packit Service 0af388
struct mpentry {
Packit Service 0af388
	char * wwid;
Packit Service 0af388
	char * alias;
Packit Service 0af388
	char * uid_attribute;
Packit Service 0af388
	char * getuid;
Packit Service 0af388
	char * selector;
Packit Service 0af388
	char * features;
Packit Service 0af388
Packit Service 0af388
	char * prio_name;
Packit Service 0af388
	char * prio_args;
Packit Service 0af388
	int prkey_source;
Packit Service 0af388
	struct be64 reservation_key;
Packit Service 0af388
	uint8_t sa_flags;
Packit Service 0af388
	int pgpolicy;
Packit Service 0af388
	int pgfailback;
Packit Service 0af388
	int rr_weight;
Packit Service 0af388
	int no_path_retry;
Packit Service 0af388
	int minio;
Packit Service 0af388
	int minio_rq;
Packit Service 0af388
	int flush_on_last_del;
Packit Service 0af388
	int attribute_flags;
Packit Service 0af388
	int user_friendly_names;
Packit Service 0af388
	int deferred_remove;
Packit Service 0af388
	int delay_watch_checks;
Packit Service 0af388
	int delay_wait_checks;
Packit Service 0af388
	int san_path_err_threshold;
Packit Service 0af388
	int san_path_err_forget_rate;
Packit Service 0af388
	int san_path_err_recovery_time;
Packit Service 0af388
	int marginal_path_err_sample_time;
Packit Service 0af388
	int marginal_path_err_rate_threshold;
Packit Service 0af388
	int marginal_path_err_recheck_gap_time;
Packit Service 0af388
	int marginal_path_double_failed_time;
Packit Service 0af388
	int skip_kpartx;
Packit Service 0af388
	int max_sectors_kb;
Packit Service 0af388
	int ghost_delay;
Packit Service 0af388
	uid_t uid;
Packit Service 0af388
	gid_t gid;
Packit Service 0af388
	mode_t mode;
Packit Service 0af388
};
Packit Service 0af388
Packit Service 0af388
struct config {
Packit Service 0af388
	struct rcu_head rcu;
Packit Service 0af388
	int verbosity;
Packit Service 0af388
	int pgpolicy_flag;
Packit Service 0af388
	int pgpolicy;
Packit Service 0af388
	int minio;
Packit Service 0af388
	int minio_rq;
Packit Service 0af388
	unsigned int checkint;
Packit Service 0af388
	unsigned int max_checkint;
Packit Service 0af388
	bool use_watchdog;
Packit Service 0af388
	int pgfailback;
Packit Service 0af388
	int rr_weight;
Packit Service 0af388
	int no_path_retry;
Packit Service 0af388
	int user_friendly_names;
Packit Service 0af388
	int bindings_read_only;
Packit Service 0af388
	int max_fds;
Packit Service 0af388
	int force_reload;
Packit Service 0af388
	int queue_without_daemon;
Packit Service 0af388
	int checker_timeout;
Packit Service 0af388
	int flush_on_last_del;
Packit Service 0af388
	int attribute_flags;
Packit Service 0af388
	int fast_io_fail;
Packit Service 0af388
	unsigned int dev_loss;
Packit Service 0af388
	int log_checker_err;
Packit Service 0af388
	int allow_queueing;
Packit Service 0af388
	int find_multipaths;
Packit Service 0af388
	uid_t uid;
Packit Service 0af388
	gid_t gid;
Packit Service 0af388
	mode_t mode;
Packit Service 0af388
	int reassign_maps;
Packit Service 0af388
	int retain_hwhandler;
Packit Service 0af388
	int detect_prio;
Packit Service 0af388
	int detect_checker;
Packit Service 0af388
	int force_sync;
Packit Service 0af388
	int deferred_remove;
Packit Service 0af388
	int processed_main_config;
Packit Service 0af388
	int delay_watch_checks;
Packit Service 0af388
	int delay_wait_checks;
Packit Service 0af388
	int san_path_err_threshold;
Packit Service 0af388
	int san_path_err_forget_rate;
Packit Service 0af388
	int san_path_err_recovery_time;
Packit Service 0af388
	int marginal_path_err_sample_time;
Packit Service 0af388
	int marginal_path_err_rate_threshold;
Packit Service 0af388
	int marginal_path_err_recheck_gap_time;
Packit Service 0af388
	int marginal_path_double_failed_time;
Packit Service 0af388
	int uxsock_timeout;
Packit Service 0af388
	int strict_timing;
Packit Service 0af388
	int retrigger_tries;
Packit Service 0af388
	int retrigger_delay;
Packit Service 0af388
	int delayed_reconfig;
Packit Service 0af388
	int uev_wait_timeout;
Packit Service 0af388
	int skip_kpartx;
Packit Service 0af388
	int remove_retries;
Packit Service 0af388
	int max_sectors_kb;
Packit Service 0af388
	int ghost_delay;
Packit Service 0af388
	int find_multipaths_timeout;
Packit Service 0af388
	int marginal_pathgroups;
Packit Service 0af388
	unsigned int version[3];
Packit Service 0af388
	unsigned int sequence_nr;
Packit Service 0af388
Packit Service 0af388
	char * multipath_dir;
Packit Service 0af388
	char * selector;
Packit Service 0af388
	struct _vector uid_attrs;
Packit Service 0af388
	char * uid_attribute;
Packit Service 0af388
	char * getuid;
Packit Service 0af388
	char * features;
Packit Service 0af388
	char * hwhandler;
Packit Service 0af388
	char * bindings_file;
Packit Service 0af388
	char * wwids_file;
Packit Service 0af388
	char * prkeys_file;
Packit Service 0af388
	char * prio_name;
Packit Service 0af388
	char * prio_args;
Packit Service 0af388
	char * checker_name;
Packit Service 0af388
	char * alias_prefix;
Packit Service 0af388
	char * partition_delim;
Packit Service 0af388
	char * config_dir;
Packit Service 0af388
	int prkey_source;
Packit Service 0af388
	int all_tg_pt;
Packit Service 0af388
	struct be64 reservation_key;
Packit Service 0af388
	uint8_t sa_flags;
Packit Service 0af388
Packit Service 0af388
	vector keywords;
Packit Service 0af388
	vector mptable;
Packit Service 0af388
	vector hwtable;
Packit Service 0af388
	struct hwentry *overrides;
Packit Service 0af388
Packit Service 0af388
	vector blist_devnode;
Packit Service 0af388
	vector blist_wwid;
Packit Service 0af388
	vector blist_device;
Packit Service 0af388
	vector blist_property;
Packit Service 0af388
	vector blist_protocol;
Packit Service 0af388
	vector elist_devnode;
Packit Service 0af388
	vector elist_wwid;
Packit Service 0af388
	vector elist_device;
Packit Service 0af388
	vector elist_property;
Packit Service 0af388
	vector elist_protocol;
Packit Service 0af388
	char *enable_foreign;
Packit Service 0af388
};
Packit Service 0af388
Packit Service 0af388
extern struct udev * udev;
Packit Service 0af388
Packit Service 0af388
int find_hwe (const struct _vector *hwtable,
Packit Service 0af388
	      const char * vendor, const char * product, const char *revision,
Packit Service 0af388
	      vector result);
Packit Service 0af388
struct mpentry * find_mpe (vector mptable, char * wwid);
Packit Service 0af388
char * get_mpe_wwid (vector mptable, char * alias);
Packit Service 0af388
Packit Service 0af388
struct hwentry * alloc_hwe (void);
Packit Service 0af388
struct mpentry * alloc_mpe (void);
Packit Service 0af388
Packit Service 0af388
void free_hwe (struct hwentry * hwe);
Packit Service 0af388
void free_hwtable (vector hwtable);
Packit Service 0af388
void free_mpe (struct mpentry * mpe);
Packit Service 0af388
void free_mptable (vector mptable);
Packit Service 0af388
Packit Service 0af388
int store_hwe (vector hwtable, struct hwentry *);
Packit Service 0af388
Packit Service 0af388
struct config *load_config (char * file);
Packit Service 0af388
struct config * alloc_config (void);
Packit Service 0af388
void free_config (struct config * conf);
Packit Service 0af388
extern struct config *get_multipath_config(void);
Packit Service 0af388
extern void put_multipath_config(void *);
Packit Service 0af388
Packit Service 0af388
int parse_uid_attrs(char *uid_attrs, struct config *conf);
Packit Service 0af388
char *get_uid_attribute_by_attrs(struct config *conf,
Packit Service 0af388
				 const char *path_dev);
Packit Service 0af388
Packit Service 0af388
#endif