Re: [libvirt] [PATCH] Only use pseudo-random generator for uuid if using /dev/random fails.

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

 



On Fri, Jan 08, 2010 at 12:51:44PM -0500, Laine Stump wrote:
> The original code. would only print the warning message if using
> /dev/random failed, but would still go ahead and call
> virUUIDGeneratePseudoRandomBytes in all cases anyway.
> ---
>  src/util/uuid.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/util/uuid.c b/src/util/uuid.c
> index 002a64d..846581c 100644
> --- a/src/util/uuid.c
> +++ b/src/util/uuid.c
> @@ -104,9 +104,9 @@ virUUIDGenerate(unsigned char *uuid)
>          VIR_WARN(_("Falling back to pseudorandom UUID,"
>                     " failed to generate random bytes: %s"),
>                   virStrerror(err, ebuf, sizeof ebuf));
> +        err = virUUIDGeneratePseudoRandomBytes(uuid, VIR_UUID_BUFLEN);
>      }
> -
> -    return virUUIDGeneratePseudoRandomBytes(uuid, VIR_UUID_BUFLEN);
> +    return err;
>  }
>  
>  /* Convert C from hexadecimal character to integer.  */

  Ah, right, ACK, pushed,

   thanks !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
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]