[libvirt] [PATCH v3 1/4] m4: checking if ssh_session_is_known_server() exists.

Julio Faracco posted 4 patches 7 years, 2 months ago
[libvirt] [PATCH v3 1/4] m4: checking if ssh_session_is_known_server() exists.
Posted by Julio Faracco 7 years, 2 months ago
This commit adds some checks inside libssh m4 checking to verify if
ssh_session_is_known_server function is available. This new function
scope replaces the old ssh_is_server_known() from libssh 0.8.0 and
below versions.

Another auxiliar enumerator was added to keep the compatibility with the
old standard used by ssh_is_server_known() function.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
---
 m4/virt-libssh.m4 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/m4/virt-libssh.m4 b/m4/virt-libssh.m4
index 01c3b75c72..52bd4d3639 100644
--- a/m4/virt-libssh.m4
+++ b/m4/virt-libssh.m4
@@ -33,6 +33,14 @@ AC_DEFUN([LIBVIRT_CHECK_LIBSSH],[
       [],
       [AC_DEFINE_UNQUOTED([ssh_get_server_publickey], [ssh_get_publickey],
             [ssh_get_publickey is deprecated and replaced by ssh_get_server_publickey.])])
+    AC_CHECK_FUNC([ssh_session_is_known_server],
+      [],
+      [AC_DEFINE_UNQUOTED([ssh_session_is_known_server], [ssh_is_server_known],
+            [ssh_is_server_known is deprecated and replaced by ssh_session_is_known_server.])])
+    AC_CHECK_TYPES([enum ssh_known_hosts_e],
+        [AC_DEFINE([HAVE_SSH_KNOWN_HOSTS_E], [1],
+          [Defined if enum ssh_known_hosts_e exists in libssh.h])],
+        [], [[#include <libssh/libssh.h>]])
     CFLAGS="$old_CFLAGS"
     LIBS="$old_LIBS"
   fi
-- 
2.19.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v3 1/4] m4: checking if ssh_session_is_known_server() exists.
Posted by Andrea Bolognani 7 years, 1 month ago
On Sat, 2018-11-24 at 03:52 +0800, Julio Faracco wrote:
> This commit adds some checks inside libssh m4 checking to verify if
> ssh_session_is_known_server function is available. This new function
> scope replaces the old ssh_is_server_known() from libssh 0.8.0 and
> below versions.
> 
> Another auxiliar enumerator was added to keep the compatibility with the
> old standard used by ssh_is_server_known() function.

You only have the check for the enum, not the definition of the
replacement one here. I guess you want to squash patch 2 in here?

[...]
> +    AC_CHECK_FUNC([ssh_session_is_known_server],
> +      [],
> +      [AC_DEFINE_UNQUOTED([ssh_session_is_known_server], [ssh_is_server_known],
> +            [ssh_is_server_known is deprecated and replaced by ssh_session_is_known_server.])])
> +    AC_CHECK_TYPES([enum ssh_known_hosts_e],
> +        [AC_DEFINE([HAVE_SSH_KNOWN_HOSTS_E], [1],
> +          [Defined if enum ssh_known_hosts_e exists in libssh.h])],
> +        [], [[#include <libssh/libssh.h>]])

We check for the availability of the new function and the enum
containing its possible return values separately: is there a chance
we might find one but not the other? I'm hoping not, but it would be
nice if you could confirm that's indeed never going to happen, as it
would be quite problematic if it did...

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list