Re: [PATCH v2 01/27] viruuid: Rework virUUIDIsValid()

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

 



On Thu, Dec 03, 2020 at 13:36:04 +0100, Michal Privoznik wrote:
> The only test we do when checking for UUID validity is that
> whether all bytes are the same (invalid UUID) or not (valid
> UUID). The algorithm we use is needlessly complicated.
> 
> Also, the checked UUID is not modified and hence the argument can
> be of 'const' type.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/util/viruuid.c | 17 +++++++----------
>  src/util/viruuid.h |  2 +-
>  2 files changed, 8 insertions(+), 11 deletions(-)

I've briefly thought whether we could replace the internals by a memset
of a temp array and then memcmp, but that doesn't seem to be worth.

Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>




[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