qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

crypto: fix building complaint

gnutls commit 846753877d renamed LIBGNUTLS_VERSION_NUMBER to GNUTLS_VERSION_NUMBER.
If using gnutls before that verion, we'll get the below warning:
crypto/tlscredsx509.c:618:5: warning: "GNUTLS_VERSION_NUMBER" is not defined

Because gnutls 3.x still defines LIBGNUTLS_VERSION_NUMBER for back compat, Let's
use LIBGNUTLS_VERSION_NUMBER instead of GNUTLS_VERSION_NUMBER to fix building
complaint.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

authored by

Gonglei and committed by
Daniel P. Berrange
d9269b27 a5d2f44d

+4 -6
+1 -2
crypto/init.c
··· 59 59 60 60 #if (defined(CONFIG_GCRYPT) && \ 61 61 (!defined(CONFIG_GNUTLS) || \ 62 - !defined(GNUTLS_VERSION_NUMBER) || \ 63 - (GNUTLS_VERSION_NUMBER < 0x020c00)) && \ 62 + (LIBGNUTLS_VERSION_NUMBER < 0x020c00)) && \ 64 63 (!defined(GCRYPT_VERSION_NUMBER) || \ 65 64 (GCRYPT_VERSION_NUMBER < 0x010600))) 66 65 #define QCRYPTO_INIT_GCRYPT_THREADS
+3 -3
crypto/tlscredsx509.c
··· 615 615 } 616 616 617 617 if (cert != NULL && key != NULL) { 618 - #if GNUTLS_VERSION_NUMBER >= 0x030111 618 + #if LIBGNUTLS_VERSION_NUMBER >= 0x030111 619 619 char *password = NULL; 620 620 if (creds->passwordid) { 621 621 password = qcrypto_secret_lookup_as_utf8(creds->passwordid, ··· 630 630 password, 631 631 0); 632 632 g_free(password); 633 - #else /* GNUTLS_VERSION_NUMBER < 0x030111 */ 633 + #else /* LIBGNUTLS_VERSION_NUMBER < 0x030111 */ 634 634 if (creds->passwordid) { 635 635 error_setg(errp, "PKCS8 decryption requires GNUTLS >= 3.1.11"); 636 636 goto cleanup; ··· 638 638 ret = gnutls_certificate_set_x509_key_file(creds->data, 639 639 cert, key, 640 640 GNUTLS_X509_FMT_PEM); 641 - #endif /* GNUTLS_VERSION_NUMBER < 0x030111 */ 641 + #endif 642 642 if (ret < 0) { 643 643 error_setg(errp, "Cannot load certificate '%s' & key '%s': %s", 644 644 cert, key, gnutls_strerror(ret));
-1
tests/crypto-tls-x509-helpers.h
··· 26 26 27 27 #if !(defined WIN32) && \ 28 28 defined(CONFIG_TASN1) && \ 29 - defined(LIBGNUTLS_VERSION_NUMBER) && \ 30 29 (LIBGNUTLS_VERSION_NUMBER >= 0x020600) 31 30 # define QCRYPTO_HAVE_TLS_TEST_SUPPORT 32 31 #endif