qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 12/23] linux-user: Call qcrypto_init if not u


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v3 12/23] linux-user: Call qcrypto_init if not using -seed
Date: Fri, 12 Apr 2019 20:44:12 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 4/10/19 11:49 PM, Philippe Mathieu-Daudé wrote:
>> -    if (seed_optarg != NULL) {
>> -        qemu_guest_random_seed_main(seed_optarg, &error_fatal);
>> +    {
> Since 7be41675f7c we use gnu99 C, so this extra block indentation can be
> removed.
> 
>> +        Error *err = NULL;
>> +        if (seed_optarg != NULL) {
>> +            qemu_guest_random_seed_main(seed_optarg, &err);
>> +        } else {
>> +            /* ??? Assumes qcrypto is only used by qemu_guest_getrandom.  */
>> +            qcrypto_init(&err);
>> +        }
>> +        if (err) {
>> +            error_reportf_err(err, "cannot initialize crypto: ");
>> +            exit(1);
>> +        }
>>      }

I could, but it also limits the scope, which is of more importance to variables
who have their address taken.  It means that their storage could (in theory) be
shared with objects not overlapping in scope.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]