Re: [Qemu-devel] [PATCH v2] crypto_gen_random() now also works on windows

2017-04-25 Thread Geert Martin Ijewski
Am 25.04.2017 um 15:42 schrieb Daniel P. Berrange: On Mon, Apr 24, 2017 at 07:51:49PM +0200, Geert Martin Ijewski wrote: +#ifdef _WIN32 +#include +HCRYPTPROV hCryptProv; +#else +int fd; /* a file handle to either /dev/urandom or /dev/random */ +#endif Lets mark both these vars 'static' Ah

Re: [Qemu-devel] [PATCH v2] crypto_gen_random() now also works on windows

2017-04-25 Thread Daniel P. Berrange
On Tue, Apr 25, 2017 at 08:52:58AM -0500, Eric Blake wrote: > On 04/25/2017 08:42 AM, Daniel P. Berrange wrote: > > On Mon, Apr 24, 2017 at 07:51:49PM +0200, Geert Martin Ijewski wrote: > >> If no crypto library is included in the build QEMU uses > >> qcrypto_random_bytes() to generate random data.

Re: [Qemu-devel] [PATCH v2] crypto_gen_random() now also works on windows

2017-04-25 Thread Eric Blake
On 04/25/2017 08:42 AM, Daniel P. Berrange wrote: > On Mon, Apr 24, 2017 at 07:51:49PM +0200, Geert Martin Ijewski wrote: >> If no crypto library is included in the build QEMU uses >> qcrypto_random_bytes() to generate random data. That function tried to open >> /dev/urandom or /dev/random and if o

Re: [Qemu-devel] [PATCH v2] crypto_gen_random() now also works on windows

2017-04-25 Thread Daniel P. Berrange
On Mon, Apr 24, 2017 at 07:51:49PM +0200, Geert Martin Ijewski wrote: > If no crypto library is included in the build QEMU uses > qcrypto_random_bytes() to generate random data. That function tried to open > /dev/urandom or /dev/random and if openeing neither file worked it errored > out. > > Thos

[Qemu-devel] [PATCH v2] crypto_gen_random() now also works on windows

2017-04-24 Thread Geert Martin Ijewski
If no crypto library is included in the build QEMU uses qcrypto_random_bytes() to generate random data. That function tried to open /dev/urandom or /dev/random and if openeing neither file worked it errored out. Those files obviously do not exist on windows, so there the code now uses CryptGe