qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] linux-user: Let user specify random seed


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] linux-user: Let user specify random seed
Date: Thu, 09 Oct 2014 15:30:05 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1

On 10/09/2014 01:12 PM, Magnus Reftel wrote:
> This patch introduces the -seed command line option and the
> QEMU_RAND_SEED environment variable for setting the random seed, which
> is used for the AT_RANDOM ELF aux entry.
> 
> Signed-off-by: Magnus Reftel <address@hidden>
> ---
>  linux-user/elfload.c |  1 -
>  linux-user/main.c    | 20 ++++++++++++++++++++
>  2 files changed, 20 insertions(+), 1 deletion(-)
> 

>  
> +static void handle_arg_randseed(const char *arg)
> +{
> +    unsigned long long seed;
> +    char *end;
> +
> +    if (parse_uint(arg, &seed, &end, 0) != 0 || *end != 0 || seed > 
> UINT_MAX) {

Slightly shorter as:

if (parse_uint_full(arg, &seed, 0) < 0 || seed > UINT_MAX) {

but that's not a functional difference.

Reviewed-by: Eric Blake <address@hidden>

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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