Re: [PATCH] tests: mock virRandomBits to make it endian stable

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

 



On Thu, Aug 02, 2018 at 08:17:25AM -0500, Eric Blake wrote:
> On 08/02/2018 06:37 AM, Daniel P. Berrangé wrote:
> > virRandomBits is implemented in terms of virRandomBytes. Although we
> > mock virRandomBytes to give a stable value, this is not sufficient to
> > make virRandomBits give a stable value. The result of virRandomBits will
> > vary depending on endianness. Thus we mock virRandomBits to return a
> > stable value directly.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
> > ---
> 
> > +uint64_t virRandomBits(int nbits)
> > +{
> > +    /* Chosen by a fair roll of a 2^64 sided dice */
> 
> Where do I get my hands on one of those?  :)
> 
> Reviewed-by: Eric Blake <eblake@xxxxxxxxxx>

Thanks, this is now pushed


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux