RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1722735 - Fix build with current libssh
Summary: Fix build with current libssh
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: libvirt
Version: 8.1
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: 8.0
Assignee: Pavel Hrdina
QA Contact: yafu
URL:
Whiteboard:
Depends On:
Blocks: 1724678
TreeView+ depends on / blocked
 
Reported: 2019-06-21 06:52 UTC by Jiri Denemark
Modified: 2020-11-14 08:37 UTC (History)
7 users (show)

Fixed In Version: libvirt-4.5.0-27.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1724678 (view as bug list)
Environment:
Last Closed: 2019-11-05 20:50:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:3345 0 None None None 2019-11-05 20:51:01 UTC

Description Jiri Denemark 2019-06-21 06:52:15 UTC
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:

Comment 1 Pavel Hrdina 2019-06-21 07:51:09 UTC
Upstream commit:

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

    rpc: virnetlibsshsession: update deprecated functions

Comment 4 yafu 2019-07-04 08:47:35 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-4.5.0-30.el8
Test steps:
Scenario 1: Build with libssh-0.9.0-1
1.Download libvirt-4.5.0-30.module+el8.1.0+3574+3a63752b.src.rpm

2.Install the src.rpm:
#rpm -ivh libvirt-4.5.0-30.module+el8.1.0+3574+3a63752b.src.rpm

3.Apply patch libvirt-rpc-virnetlibsshsession-update-deprecated-functions.patch:
#cd /root/rpmbuild/ && tar xvf libvirt-4.5.0.tar.xz
#cd libvirt-4.5.0/
#patch  -p1 < /root/rpmbuild/SOURCES/libvirt-rpc-virnetlibsshsession-update-deprecated-functions.patch

4.Build the source code and no libssh error:
#automake
#./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 5 yafu 2019-07-04 08:52:32 UTC
Hi, Pavel,

When connect libvirtd with libssh, it reports error if no other service has created /root/.config dir before:
# virsh -c qemu+libssh://yafu-70-118/system
Accept SSH host key with hash '35:f3:f4:a2:11:b5:01:0e:12:d6:7e:57:4b:b0:45:98:21:80:a7:41' for host 'yafu-70-118:22' (y/n)?: y
error: failed to connect to the hypervisor
error: libssh transport error: failed to write known_host file '/root/.config/libvirt/known_hosts': Cannot create /root/.config/libvirt directory.

Would you help to check whether it's a issue of libvirtd please? Thanks.

Comment 6 Pavel Hrdina 2019-07-26 09:54:02 UTC
Hi Yan,

I was checking documentation for the API we use from libssh and it doesn't says anything
how it creates the directory.  If libssh is able to create the /root/.config/libvirt
directory it should be probably able to create /root/.config as well so I would say
this is most likely BUG in libssh.

Try to create a new BZ for libssh and we will see what they think about it.

Did you manage to hit the same issue with older libvirt where this BZ is not fixed?

Comment 7 yafu 2019-07-29 08:24:00 UTC
(In reply to Pavel Hrdina from comment #6)
> Hi Yan,
> 
> I was checking documentation for the API we use from libssh and it doesn't
> says anything
> how it creates the directory.  If libssh is able to create the
> /root/.config/libvirt
> directory it should be probably able to create /root/.config as well so I
> would say
> this is most likely BUG in libssh.
> 
> Try to create a new BZ for libssh and we will see what they think about it.
> 
> Did you manage to hit the same issue with older libvirt where this BZ is not
> fixed?

File a bug for libssh:
https://bugzilla.redhat.com/show_bug.cgi?id=1733914

And the issue can also be reproduced with libvirt-4.5.0-23.el8.x86_64.

Comment 8 yafu 2019-08-05 06:44:19 UTC
Move the bug to verified according to comment #4.

Comment 10 errata-xmlrpc 2019-11-05 20:50:27 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/RHSA-2019:3345


Note You need to log in before you can comment on or make changes to this bug.