Bug 1724678

Summary: Fix build with current libssh
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Pavel Hrdina <phrdina>
Component: libvirtAssignee: Pavel Hrdina <phrdina>
Status: CLOSED ERRATA QA Contact: yafu <yafu>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 8.1CC: chhu, dyuan, jdenemar, rbalakri, xuzhang, yafu, yalzhang
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-5.4.0-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1722735 Environment:
Last Closed: 2019-11-06 07:17:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1722735    
Bug Blocks:    

Description Pavel Hrdina 2019-06-27 14:08:41 UTC
+++ This bug was initially created as a clone of Bug #1722735 +++

Description of problem:

Building libvirt in RHEL-8.1.0 after libssh was updated fails with

rpc/virnetlibsshsession.c: In function 'virNetLibsshCheckHostKey':
rpc/virnetlibsshsession.c:290:5: error: 'ssh_is_server_known' is deprecated [-Werror=deprecated-declarations]
     state = ssh_is_server_known(sess->session);
     ^~~~~
In file included from rpc/virnetlibsshsession.c:24:
/usr/include/libssh/libssh.h:560:31: note: declared here
 SSH_DEPRECATED LIBSSH_API int ssh_is_server_known(ssh_session session);
                               ^~~~~~~~~~~~~~~~~~~
rpc/virnetlibsshsession.c:384:13: error: 'ssh_write_knownhost' is deprecated [-Werror=deprecated-declarations]
             if (ssh_write_knownhost(sess->session) < 0) {
             ^~
In file included from rpc/virnetlibsshsession.c:24:
/usr/include/libssh/libssh.h:558:31: note: declared here
 SSH_DEPRECATED LIBSSH_API int ssh_write_knownhost(ssh_session session);
                               ^~~~~~~~~~~~~~~~~~~

Version-Release number of selected component (if applicable):

libvirt-4.5.0-25.el8

How reproducible:

100%

Steps to Reproduce:
1. build libvirt on RHEL 8.1.0

Actual results:


Expected results:


Additional info:

--- Additional comment from Pavel Hrdina on 2019-06-21 09:51:09 CEST ---

Upstream commit:

commit e0ce339c317306711a17253f363c19ac134e9763
Author: Pavel Hrdina <phrdina>
Date:   Fri Jun 21 09:18:11 2019 +0200

    rpc: virnetlibsshsession: update deprecated functions

Comment 2 yafu 2019-07-04 09:50:01 UTC
Reproduced with libvirt-4.5.0-25.el8.

Reproduced steps:
Build libvirt-4.5.0-25 with libssh-0.9.0-1
#make rpm
...
rpc/virnetlibsshsession.c: In function 'virNetLibsshCheckHostKey':
rpc/virnetlibsshsession.c:290:5: error: 'ssh_is_server_known' is deprecated [-Werror=deprecated-declarations]
     state = ssh_is_server_known(sess->session);
     ^~~~~
In file included from rpc/virnetlibsshsession.c:24:
/usr/include/libssh/libssh.h:560:31: note: declared here
 SSH_DEPRECATED LIBSSH_API int ssh_is_server_known(ssh_session session);
                               ^~~~~~~~~~~~~~~~~~~
rpc/virnetlibsshsession.c:384:13: error: 'ssh_write_knownhost' is deprecated [-Werror=deprecated-declarations]
             if (ssh_write_knownhost(sess->session) < 0) {
             ^~
In file included from rpc/virnetlibsshsession.c:24:
/usr/include/libssh/libssh.h:558:31: note: declared here
 SSH_DEPRECATED LIBSSH_API int ssh_write_knownhost(ssh_session session);
                               ^~~~~~~~~~~~~~~~~~~
...

Verified with libvirt-5.5.0-1.el8.
Test steps:
Scenario 1: Build with libssh-0.9.0-1
1.Download libvirt-5.5.0-1.module+el8.1.0+3580+d7f6488d.src.rpm

2.Install the src.rpm:
#rpm -ivh libvirt-5.5.0-1.module+el8.1.0+3580+d7f6488d.src.rpm

3.Apply patch libvirt-rpc-virnetlibsshsession-update-deprecated-functions.patch:
#cd /root/rpmbuild/ && tar xvf libvirt-5.5.0.tar.xz
#cd libvirt-5.5.0/
#./autogen.sh
#make rpm

Scenario 2: Build with libssh-0.8.91-0.1
Test steps and expected results are the same with scenario 1.

Comment 3 yafu 2019-08-05 06:44:57 UTC
Move the bug to verified according to comment #2.

Comment 5 errata-xmlrpc 2019-11-06 07:17:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3723