[libvirt] [PATCH 01/13] Remove manual one-shot global initializers

Eric Blake eblake at redhat.com
Tue Jul 31 19:32:16 UTC 2012


On 07/31/2012 01:17 PM, Daniel P. Berrange wrote:
> On Tue, Jul 31, 2012 at 01:06:59PM -0600, Eric Blake wrote:
>> On 07/31/2012 10:58 AM, Daniel P. Berrange wrote:
>>> From: "Daniel P. Berrange" <berrange at redhat.com>
>>>

>>> -        virRandomInitialize(time(NULL) ^ getpid()) ||
>>> -        virNodeSuspendInit() < 0)
>>> +        virRandomInitialize(time(NULL) ^ getpid()))
>>
>> ...should we be getting rid of virRandomInitialize and doing that in a
>> one-shot initializer as well, since at least seclabeltest would have
>> benefitted from it?
> 
> I did wonder about that when I wrote this. I didn't do it because
> obviously virRandomInitialize has a parameter passed in. Now I see
> that every single caller just does the same 'time(NULL) ^ getpid()'
> we might as well just make virRandomInitialize be 'void' and used
> the fixed pattern for seed.
> 
> I'll do this as a followup patch though

Agreed.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120731/04d694f4/attachment-0001.sig>


More information about the libvir-list mailing list