[libvirt] [PATCH] gcrypt: fix build in case we do not use gnutls and gcrypt

Olga Krishtal okrishtal at virtuozzo.com
Thu Nov 3 14:34:27 UTC 2016


On 03/11/16 17:13, Martin Kletzander wrote:
> On Thu, Nov 03, 2016 at 04:14:34PM +0300, Olga Krishtal wrote:
>> In case when we use any crypt library and gnutls make returns
>> compilation errors.
>>
>
> Add info that it's caused by 680d2f49dad425395de627a31006cb84848cfa65,
> please.
>
>> Signed-off-by: Olga Krishtal <okrishtal at virtuozzo.com>
>> ---
>> src/libvirt.c | 13 ++++++-------
>> 1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/src/libvirt.c b/src/libvirt.c
>> index 52462e3..77365d1 100644
>> --- a/src/libvirt.c
>> +++ b/src/libvirt.c
>> @@ -269,7 +269,7 @@ virWinsockInit(void)
>> }
>> #endif
>>
>> -
>> +#ifdef WITH_GNUTLS
>> #ifdef WITH_GNUTLS_GCRYPT
>
> This will fail syntax-check because the second line is not indented.  I
> would rather change it to:
>
> #if defined WITH_GNUTLS && defined WITH_GNUTLS_GCRYPT
>
> With that you also don't need to add another #endif.
>
> But I feel like way better thing here would be to actually fix the
> offending commit by not even checking for GNUTLS_GCRYPT if we're not
> going to build with GNUTLS anyway.  That's how it worked before.
>
>> static int
>> virTLSMutexInit(void **priv)
>> @@ -332,6 +332,7 @@ static struct gcry_thread_cbs virTLSThreadImpl = {
>>     NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
>> };
>> #endif /* WITH_GNUTLS_GCRYPT */
>> +#endif /* WITH_GNUTLS */
>>
>>
>> static bool virGlobalError;
>> @@ -357,6 +358,7 @@ virGlobalInit(void)
>>     }
>> #endif
>>
>> +#ifdef WITH_GNUTLS
>> #ifdef WITH_GNUTLS_GCRYPT
>>     /*
>>      * This sequence of API calls it copied exactly from
>> @@ -371,13 +373,10 @@ virGlobalInit(void)
>>         gcry_control(GCRYCTL_DISABLE_SECMEM, NULL, 0);
>>         gcry_control(GCRYCTL_INITIALIZATION_FINISHED, NULL, 0);
>>     }
>> -#endif
>> -
>> -    virLogSetFromEnv();
>> -
>> -#ifdef WITH_GNUTLS
>> +#endif /* End of WITH_GNUTLS_GCRYPT*/
>>     virNetTLSInit();
>> -#endif
>> +#endif /* End of WITH_GNUTLS*/
>> +    virLogSetFromEnv();
>>
>> #if WITH_CURL
>>     curl_global_init(CURL_GLOBAL_DEFAULT);
>> -- 
>> 1.8.3.1
>>
>> -- 
>> libvir-list mailing list
>> libvir-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/libvir-list
Yes, I agree that fixing the commit is better idea. I'll send the second 
variant.

-- 
Best regards,
Olga




More information about the libvir-list mailing list