diff mbox series

[1/2] libmpathcmd: reinstate ABI 1.0.0

Message ID 20240813094046.21644-1-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series [1/2] libmpathcmd: reinstate ABI 1.0.0 | expand

Commit Message

Martin Wilck Aug. 13, 2024, 9:40 a.m. UTC
__mpath_connect() was part of our public ABI. Instead of removing
it completely, define it as a weak alias of the new mpath_connect__().
This way, programs linked against previous versions of libmpathcmd
will continue to work.

This shouldn't interfere with general symbol naming rules, as a weak
symbol won't override a library symbol of the same name.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmpathcmd/libmpathcmd.version | 12 ++++++++----
 libmpathcmd/mpath_cmd.c         |  3 +++
 2 files changed, 11 insertions(+), 4 deletions(-)

Comments

Benjamin Marzinski Aug. 14, 2024, 9:45 p.m. UTC | #1
On Tue, Aug 13, 2024 at 11:40:45AM +0200, Martin Wilck wrote:

For the set:
Tested-by: Benjamin Marzinski <bmarzins@redhat.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>

> __mpath_connect() was part of our public ABI. Instead of removing
> it completely, define it as a weak alias of the new mpath_connect__().
> This way, programs linked against previous versions of libmpathcmd
> will continue to work.
> 
> This shouldn't interfere with general symbol naming rules, as a weak
> symbol won't override a library symbol of the same name.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  libmpathcmd/libmpathcmd.version | 12 ++++++++----
>  libmpathcmd/mpath_cmd.c         |  3 +++
>  2 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/libmpathcmd/libmpathcmd.version b/libmpathcmd/libmpathcmd.version
> index a786c25..81bdb2b 100644
> --- a/libmpathcmd/libmpathcmd.version
> +++ b/libmpathcmd/libmpathcmd.version
> @@ -10,16 +10,20 @@
>   *
>   * See libmultipath.version for general policy about version numbers.
>   */
> -LIBMPATHCMD_2.0.0 {
> +
> +LIBMPATHCMD_1.0.0 {
>  global:
>  	mpath_connect;
> -	mpath_connect__;
> +	__mpath_connect;
>  	mpath_disconnect;
>  	mpath_process_cmd;
>  	mpath_recv_reply;
>  	mpath_recv_reply_len;
>  	mpath_recv_reply_data;
>  	mpath_send_cmd;
> -local:
> -	*;
>  };
> +
> +LIBMPATHCMD_1.1.0 {
> +global:
> +	mpath_connect__;
> +} LIBMPATHCMD_1.0.0;
> diff --git a/libmpathcmd/mpath_cmd.c b/libmpathcmd/mpath_cmd.c
> index 1fa036c..a38e8b6 100644
> --- a/libmpathcmd/mpath_cmd.c
> +++ b/libmpathcmd/mpath_cmd.c
> @@ -133,6 +133,9 @@ int mpath_connect__(int nonblocking)
>  	return fd;
>  }
>  
> +extern int __mpath_connect(int)
> +	__attribute__((weak, alias("mpath_connect__")));
> +
>  /*
>   * connect to a unix domain socket
>   */
> -- 
> 2.46.0
diff mbox series

Patch

diff --git a/libmpathcmd/libmpathcmd.version b/libmpathcmd/libmpathcmd.version
index a786c25..81bdb2b 100644
--- a/libmpathcmd/libmpathcmd.version
+++ b/libmpathcmd/libmpathcmd.version
@@ -10,16 +10,20 @@ 
  *
  * See libmultipath.version for general policy about version numbers.
  */
-LIBMPATHCMD_2.0.0 {
+
+LIBMPATHCMD_1.0.0 {
 global:
 	mpath_connect;
-	mpath_connect__;
+	__mpath_connect;
 	mpath_disconnect;
 	mpath_process_cmd;
 	mpath_recv_reply;
 	mpath_recv_reply_len;
 	mpath_recv_reply_data;
 	mpath_send_cmd;
-local:
-	*;
 };
+
+LIBMPATHCMD_1.1.0 {
+global:
+	mpath_connect__;
+} LIBMPATHCMD_1.0.0;
diff --git a/libmpathcmd/mpath_cmd.c b/libmpathcmd/mpath_cmd.c
index 1fa036c..a38e8b6 100644
--- a/libmpathcmd/mpath_cmd.c
+++ b/libmpathcmd/mpath_cmd.c
@@ -133,6 +133,9 @@  int mpath_connect__(int nonblocking)
 	return fd;
 }
 
+extern int __mpath_connect(int)
+	__attribute__((weak, alias("mpath_connect__")));
+
 /*
  * connect to a unix domain socket
  */