device-mapper-multipath/0081-libmpathpersist-call-libmultipath_-init-exit.patch
Benjamin Marzinski 2cf40b2f98 device-mapper-multipath-0.8.4-7
- Add 0073-libmultipath-util-constify-function-arguments.patch
- Add 0074-libmultipath-constify-file-argument-in-config-parser.patch
- Add 0075-libmultipath-provide-defaults-for-get-put-_multipath.patch
- Add 0076-libmpathpersist-allow-using-libmultipath-get-put-_mu.patch
- Add 0077-multipath-use-get_put-_multipath_config-from-libmult.patch
- Add 0078-mpathpersist-use-get-put-_multipath_config-from-libm.patch
- Add 0079-libmultipath-add-udev-and-logsink-symbols.patch
- Add 0080-multipath-remove-logsink-and-udev.patch
- Add 0081-libmpathpersist-call-libmultipath_-init-exit.patch
- Add 0082-mpathpersist-remove-logsink-and-udev.patch
- Add 0083-multipathd-remove-logsink-and-udev.patch
  * Pull in upsteam library changes
- Add 0084-libmpathvalid-use-default-_multipath_config-udev-and.patch
- Add 0085-Revert-libmultipath-add-ignore_udev_uid-option.patch
- Add 0086-libmultipath-change-log-level-for-null-uid_attribute.patch
- Add 0087-libmultipath-orphan_paths-avoid-BUG-message.patch
  * update libmpathvalid to use upstream library changes. changes
    submitted upstream
2020-09-27 00:56:23 -05:00

99 lines
3.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Thu, 24 Sep 2020 15:37:14 +0200
Subject: [PATCH] libmpathpersist: call libmultipath_{init,exit}()
Have libmpathpersist_{init,exit} do the udev initialization, too.
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmpathpersist/mpath_persist.c | 13 +++++++++----
libmpathpersist/mpath_persist.h | 9 ++++++---
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c
index 9dfc98cd..d1538195 100644
--- a/libmpathpersist/mpath_persist.c
+++ b/libmpathpersist/mpath_persist.c
@@ -48,6 +48,10 @@ int libmpathpersist_init(void)
struct config *conf;
int rc = 0;
+ if (libmultipath_init()) {
+ condlog(0, "Failed to initialize libmultipath.");
+ return 1;
+ }
if (init_config(DEFAULT_CONFIGFILE)) {
condlog(0, "Failed to initialize multipath config.");
return 1;
@@ -74,24 +78,25 @@ mpath_lib_init (void)
static void libmpathpersist_cleanup(void)
{
- dm_lib_release();
- dm_lib_exit();
cleanup_prio();
cleanup_checkers();
+ libmultipath_exit();
+ dm_lib_release();
+ dm_lib_exit();
}
int
mpath_lib_exit (struct config *conf)
{
- libmpathpersist_cleanup();
free_config(conf);
+ libmpathpersist_cleanup();
return 0;
}
int libmpathpersist_exit(void)
{
- libmpathpersist_cleanup();
uninit_config();
+ libmpathpersist_cleanup();
return 0;
}
diff --git a/libmpathpersist/mpath_persist.h b/libmpathpersist/mpath_persist.h
index 91606efc..5435eae4 100644
--- a/libmpathpersist/mpath_persist.h
+++ b/libmpathpersist/mpath_persist.h
@@ -176,7 +176,8 @@ struct prout_param_descriptor { /* PROUT parameter descriptor */
* Initialize device mapper multipath configuration. This function must be invoked first
* before performing reservation management functions.
* Either this function or mpath_lib_init() may be used.
- * Use this function to work with libmultipath's internal "struct config".
+ * Use this function to work with libmultipath's internal "struct config"
+ * and "struct udev". The latter will be initialized automatically.
* Call libmpathpersist_exit() for cleanup.
* RESTRICTIONS:
*
@@ -189,7 +190,8 @@ extern int libmpathpersist_init (void);
* Initialize device mapper multipath configuration. This function must be invoked first
* before performing reservation management functions.
* Either this function or libmpathpersist_init() may be used.
- * Use this function to work with an application-specific "struct config".
+ * Use this function to work with an application-specific "struct config"
+ * and "struct udev". The latter must be initialized by the application.
* Call mpath_lib_exit() for cleanup.
* RESTRICTIONS:
*
@@ -211,9 +213,10 @@ extern int mpath_lib_exit (struct config *conf);
/*
* DESCRIPTION :
- * Release device mapper multipath configuration. This function must be invoked after
+ * Release device mapper multipath configuration a. This function must be invoked after
* performing reservation management functions.
* Use this after initialization with libmpathpersist_init().
+ * Calling libmpathpersist_init() after libmpathpersist_exit() will fail.
* RESTRICTIONS:
*
* RETURNS: 0->Success, 1->Failed.
--
2.17.2