On Wed, Mar 13, 2019 at 08:25:45AM -0700, Richard Henderson wrote: > On 3/12/19 11:41 PM, no-re...@patchew.org wrote: > > time make docker-test-mingw@fedora SHOW_ENV=1 J=14 NETWORK=1 > > === TEST SCRIPT END === > > > > CC hw/acpi/trace.o > > CC hw/alpha/trace.o > > /tmp/qemu-test/src/util/random.c: In function 'do_jrand48': > > /tmp/qemu-test/src/util/random.c:41:15: error: implicit declaration of > > function 'jrand48'; did you mean 'do_jrand48'? > > [-Werror=implicit-function-declaration] > > val = jrand48(xsubi); > > Hmm, no jrand48 in mingw. I assumed it would be there because of POSIX. > Perhaps I should just bite the bullet and inline my own DRNG...
We already have an internal API for providing strong random bytes in QEMU qcrypto_random_bytes. It is preferentially backed by gnutls or gcrypt, but if those aren't built-in it falls back to a platform native API like /dev/random. I've got a todo item to make that use getrandom on Linux/BSD when available. I don't think we should be adding a new APIs for getting random numbers that aren't backed by the qcrypto_random_bytes. By all means add wrappers around qcrypto_random_bytes to make it more convenient to get random numbers with a given data types (int64, int32 etc) though. 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 :|