I think that libssh in Ubuntu 18.04 is just broken. I don't think that we'll include a work-around in QEMU for this anymore, now that 20.04 is already released and works fine. Thus closing this as WONTFIX.
** Changed in: qemu Status: Confirmed => Won't Fix -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1838763 Title: Bugs in SSH module (ssh.c) Status in QEMU: Won't Fix Bug description: I installed gcc-8&libssh* on my Ubuntu 18.04 arm64.When I was compiling any version of qemu like 3.1.0 4.0.0or 4.1.0 with SSH support,the GCC went wrong.It said some vars undeclared like'SSH_KNOWN_HOSTS_OTHER','SSH_KNOWN_HOST_UNKNOWN',etc. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1838763/+subscriptions