[PATCH 2/2] scsi/qemu-pr-helper: Use defaults [get/set]_multipath_config() impl

Philippe Mathieu-Daudé posted 2 patches 2 years, 8 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Fam Zheng <fam@euphon.net>
[PATCH 2/2] scsi/qemu-pr-helper: Use defaults [get/set]_multipath_config() impl
Posted by Philippe Mathieu-Daudé 2 years, 8 months ago
Commit b3f1c8c413 ("qemu-pr-helper: use new libmultipath API")
declared the two [get/set]_multipath_config() functions to
satisfy the 'new' API. The library already provides an internal
implementation for these helpers, exposed as weak symbols.
Since our implementation doesn't provide much, we can default
to the internal implementation.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 scsi/qemu-pr-helper.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c
index ae44a816e1..4d64e6b53c 100644
--- a/scsi/qemu-pr-helper.c
+++ b/scsi/qemu-pr-helper.c
@@ -261,26 +261,14 @@ static void dm_init(void)
 
 /* Variables required by libmultipath and libmpathpersist.  */
 QEMU_BUILD_BUG_ON(PR_HELPER_DATA_SIZE > MPATH_MAX_PARAM_LEN);
-static struct config *multipath_conf;
 unsigned mpath_mx_alloc_len = PR_HELPER_DATA_SIZE;
 int logsink;
 struct udev *udev;
 
-extern struct config *get_multipath_config(void);
-struct config *get_multipath_config(void)
-{
-    return multipath_conf;
-}
-
-extern void put_multipath_config(struct config *conf);
-void put_multipath_config(struct config *conf)
-{
-}
-
 static void multipath_pr_init(void)
 {
     udev = udev_new();
-    multipath_conf = mpath_lib_init();
+    mpath_lib_init();
 }
 
 static int is_mpath(int fd)
-- 
2.38.1


Re: [PATCH 2/2] scsi/qemu-pr-helper: Use defaults [get/set]_multipath_config() impl
Posted by Paolo Bonzini 2 years, 8 months ago
On 6/5/23 19:41, Philippe Mathieu-Daudé wrote:
> Commit b3f1c8c413 ("qemu-pr-helper: use new libmultipath API")
> declared the two [get/set]_multipath_config() functions to
> satisfy the 'new' API. The library already provides an internal
> implementation for these helpers, exposed as weak symbols.
> Since our implementation doesn't provide much, we can default
> to the internal implementation.

This seems to be still needed in RHEL8, see 
https://www.spinics.net/lists/dm-devel/msg49851.html (March 2022).

Queued patch 1 though, thanks.

Paolo