multipathdir = $(TOPDIR)/libmultipath
daemondir = $(TOPDIR)/multipathd
mpathutildir = $(TOPDIR)/libmpathutil
-man8dir = $(prefix)/usr/share/man/man8
-man5dir = $(prefix)/usr/share/man/man5
-man3dir = $(prefix)/usr/share/man/man3
+man8dir = $(prefix)/share/man/man8
+man5dir = $(prefix)/share/man/man5
+man3dir = $(prefix)/share/man/man3
syslibdir = $(prefix)/$(LIB)
usrlibdir = $(usr_prefix)/$(LIB)
libdir = $(prefix)/$(LIB)/multipath
thirdpartydir = $(TOPDIR)/third-party
libdmmpdir = $(TOPDIR)/libdmmp
nvmedir = $(TOPDIR)/libmultipath/nvme
-includedir = $(prefix)/usr/include
+includedir = $(prefix)/include
pkgconfdir = $(usrlibdir)/pkgconfig
plugindir := $(prefix)/$(LIB)/multipath
configdir := $(prefix)/etc/multipath/conf.d
#include <libudev.h>
#include "globals.h"
-struct udev __attribute__((weak)) *udev;
-struct config __attribute__((weak)) *get_multipath_config(void)
+struct config *get_multipath_config(void)
{
return NULL;
}
-void __attribute__((weak)) put_multipath_config(void *p __attribute__((unused)))
+void put_multipath_config(void *p __attribute__((unused)))
{}
struct config;
-/**
- * extern variable: udev
- *
- * A &struct udev instance used by libmultipath. libmultipath expects
- * a valid, initialized &struct udev in this variable.
- * An application can define this variable itself, in which case
- * the applications's instance will take precedence.
- * The application can initialize and destroy this variable by
- * calling libmultipath_init() and libmultipath_exit(), respectively,
- * whether or not it defines the variable itself.
- * An application can initialize udev with udev_new() before calling
- * libmultipath_init(), e.g. if it has to make libudev calls before
- * libmultipath calls. If an application wants to keep using the
- * udev variable after calling libmultipath_exit(), it should have taken
- * an additional reference on it beforehand. This is the case e.g.
- * after initializing udev with udev_new().
- */
-extern struct udev *udev;
-
/*
* libmultipath provides default implementations of
* get_multipath_config() and put_multipath_config().
* The new version inherits the previous ones.
*/
+/*
+ * Symbols exported by both libmpathutil and libmultipath
+ * libmpathutil exports just dummy symbols, intended to be overriden
+ * by those in libmultipath.
+ * CAUTION - the version in libmpathutil.version and libmultipath.version
+ * must be THE SAME, otherwise the overriding will fail!
+ */
+LIBMPATHCOMMON_1.0.0 {
+ get_multipath_config;
+ put_multipath_config;
+};
+
/* symbols referenced by multipath and multipathd */
LIBMULTIPATH_16.0.0 {
global:
free_scandir_result;
free_strvec;
get_monotonic_time;
- get_multipath_config;
get_next_string;
get_strbuf_len;
get_strbuf_str;
normalize_timespec;
print_strbuf;
pthread_cond_init_mono;
- put_multipath_config;
recv_packet;
reset_strbuf;
send_packet;
timespeccmp;
timespecsub;
truncate_strbuf;
- udev;
ux_socket_listen;
vector_alloc;
vector_alloc_slot;
append_strbuf_quoted;
basenamecpy;
cleanup_free_ptr;
- devt2devname;
filepresent;
find_keyword;
free_keywords;
return bytes;
}
-int devt2devname(char *devname, int devname_len, const char *devt)
-{
- struct udev_device *u_dev;
- const char * dev_name;
- int r;
-
- if (!devname || !devname_len || !devt)
- return 1;
-
- u_dev = udev_device_new_from_devnum(udev, 'b', parse_devt(devt));
- if (!u_dev) {
- condlog(0, "\"%s\": invalid major/minor numbers, not found in sysfs", devt);
- return 1;
- }
-
- dev_name = udev_device_get_sysname(u_dev);
- if (!dev_name) {
- udev_device_unref(u_dev);
- return 1;
- }
- r = strlcpy(devname, dev_name, devname_len);
- udev_device_unref(u_dev);
-
- return !(r < devname_len);
-}
-
/* This function returns a pointer inside of the supplied pathname string.
* If is_path_device is true, it may also modify the supplied string */
char *convert_dev(char *name, int is_path_device)
int get_word (const char * sentence, char ** word);
size_t strlcpy(char * restrict dst, const char * restrict src, size_t size);
size_t strlcat(char * restrict dst, const char * restrict src, size_t size);
-int devt2devname (char *, int, const char *);
dev_t parse_devt(const char *dev_t);
char *convert_dev(char *dev, int is_path_device);
void setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached);
* The new version inherits the previous ones.
*/
+/*
+ * Symbols exported by both libmpathutil and libmultipath
+ * libmpathutil exports just dummy symbols, intended to be overriden
+ * by those in libmultipath.
+ * CAUTION - the version in libmpathutil.version and libmultipath.version
+ * must be THE SAME, otherwise the overriding will fail!
+ */
+LIBMPATHCOMMON_1.0.0 {
+ get_multipath_config;
+ put_multipath_config;
+};
+
LIBMULTIPATH_17.0.0 {
global:
/* symbols referenced by multipath and multipathd */
free_multipathvec;
free_path;
free_pathvec;
- get_multipath_config;
get_multipath_layout;
get_path_layout;
get_pgpolicy_id;
libmp_dm_task_run;
libmp_put_multipath_config;
libmp_udev_set_sync_support;
- libmp_verbosity;
libmultipath_exit;
libmultipath_init;
load_config;
print_all_paths;
print_foreign_topology;
_print_multipath_topology;
- put_multipath_config;
reinstate_paths;
remember_wwid;
remove_map;
#include "util.h"
#include "debug.h"
#include "devmapper.h"
+#include "config.h"
/*
* When we modify an attribute value we cannot rely on libudev for now,
return 0;
}
+int devt2devname(char *devname, int devname_len, const char *devt)
+{
+ struct udev_device *u_dev;
+ const char * dev_name;
+ int r;
+
+ if (!devname || !devname_len || !devt)
+ return 1;
+
+ u_dev = udev_device_new_from_devnum(udev, 'b', parse_devt(devt));
+ if (!u_dev) {
+ condlog(0, "\"%s\": invalid major/minor numbers, not found in sysfs", devt);
+ return 1;
+ }
+
+ dev_name = udev_device_get_sysname(u_dev);
+ if (!dev_name) {
+ udev_device_unref(u_dev);
+ return 1;
+ }
+ r = strlcpy(devname, dev_name, devname_len);
+ udev_device_unref(u_dev);
+
+ return !(r < devname_len);
+}
+
int sysfs_check_holders(char * check_devt, char * new_devt)
{
unsigned int major, new_minor, table_minor;
#include <stdbool.h>
#include "strbuf.h"
+int devt2devname (char *, int, const char *);
ssize_t sysfs_attr_set_value(struct udev_device *dev, const char *attr_name,
const char * value, size_t value_len);
ssize_t sysfs_attr_get_value(struct udev_device *dev, const char *attr_name,
#ifndef _VERSION_H
#define _VERSION_H
-#define VERSION_CODE 0x000902
+#define VERSION_CODE 0x000903
/* MMDDYY, in hex */
-#define DATE_CODE 0x0A1816
+#define DATE_CODE 0x0A1A16
#define PROG "multipath-tools"
#include "util.h"
#include "debug.h"
+struct path;
+#include "sysfs.h"
+
#include "globals.c"
static bool sys_dev_block_exists(void)